in reply to Re^2: print UTF-8 problem
in thread print UTF-8 problem

It prints gibberish to the Windows console (aka "DOS box"), instead of the right UTF-8 characters.

What makes you think your console understands UTF-8? Type chcp at the prompt, prepend "cp" to the number, and use that as the encoding.

Replies are listed 'Best First'.
Re^4: print UTF-8 problem
by HelenCr (Monk) on Feb 15, 2012 at 20:26 UTC
    At the Windows console, I type "chcp 65001" (and then it says: "Code page: 65001") and I also change the console font to "Lucida Console". But that doesn't help.
      cp65001 is UTF-8, so that's good. What do you expect instead of <הער׳11>? It would also be good to have the input and output in hex form.

        It seems that it's not a Perl problem. I have a wide-character text file that looks fine in Notepad ("UTF-8 encoding"), in Notepad++, and when I cut-and-paste into MS Word it looks fine too. But when I open a "DOS box" (Windows console) and go: "type file.txt", it prints gibberish.

        And yes, I did all the recommendations for Unicode on Windows console: I opened the console using "cmd /u", I changed the font to Lucida, and I've entered: "chcp 65001".