Well, first of all the default STDOUT behavior seems to truncate characters to 8 bits and warn if the ordinal was >255, NOT do a encoding translation to the current character set.
If the "current" set of 256 characters (the Code Page) is enough and I don't worry about UTF-8, the results in the Console don't match what appears in the source. That's because the Windows Code Page is 1252, but for compatibility with old text-mode code from DOS, the Console uses the old DOS code page by default.
So, I use the commands
at the prompt, expecting it will not match the rest of the machine.chcp 1252 mode con cp select=1252
Nope! The results of programs running standard output, or the type command, etc. are still showing the DOS characters.
Anybody know the right incantation to make the Windows Console use the desired code page in this manner?
Better yet, is there a way to make Perl's output use the full Unicode capability of the Console? I'm thinking that a tie'd handle could feed to the Win32 API functions, skipping the OS's file stream.
Best of all, is there a way to make the OS's stream (that's attached to the Console) use UTF-8? That would work with any program, not just Perl.
—John
In reply to Character Encoding and Windows Console woes by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |