cmd.exe on WIndows - problem with displaying some Unicode characters

Chris Angelico rosuav at gmail.com
Sun Aug 3 19:39:35 EDT 2014


On Mon, Aug 4, 2014 at 9:25 AM, Andrew Berg
<aberg010 at my.hennepintech.edu> wrote:
> On 2014.08.03 18:08, Chris Angelico wrote:
>> The best way to do it is to use the Unicode codepage, but cmd.exe just
>> plain has issues. There are underlying Windows APIs for displaying
>> text that have problems with astral characters (I think that's what it
>> is), so ultimately, you're largely stuck.
> That is not quite true. The terminal has these issues, not the shell. Using
> cp65001 does make Unicode in a Windows terminal possible, but using a better
> terminal[1] makes it almost perfect (my experience has been that input can be
> difficult, but output works well). I personally have used an IRC bot written in
> Python with logging output containing Unicode characters that display just fine
> (both locally and over SSH).
>
> [1] I recommend ConEmu: https://code.google.com/p/conemu-maximus5/

Sorry, yeah, my terminology was sloppy. It's not technically cmd.exe,
but the default console.

I just played around with a CP-437 decode of everything 128-255,
rendered in various different fonts, all using my MUD client on
Windows. (For what it's worth, it renders using GTK2 and Pango. But I
suspect this is more a font issue than a display engine one.) Most
fonts had those little boxes-with-numbers for most of the line drawing
characters, but Lucida Sans Unicode, Meiryo, and Tahoma all managed to
display all the characters. However, I wasn't able to visually
distinguish between the single-line and double-line characters, so you
may want to play around with it a bit more.

Your simplest solution may still be to abandon those double lines and
just go with single.

ChrisA



More information about the Python-list mailing list