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

Christian Gollwitzer auriocus at gmx.de
Mon Aug 4 16:35:28 EDT 2014


Am 04.08.14 01:08, schrieb Chris Angelico:
> On Mon, Aug 4, 2014 at 8:52 AM, Wiktor <look at signature.invalid> wrote:
>> I have to ask - is there a way to make that original concept work? I know,
>> that CP437 has symbols "╖", "╢" and "╘", but does not have polish letters -
>> and I need to display them too.
>
> Yeah, that's exactly the problem with codepages :)
>
> The best way to do it is to use the Unicode codepage,

Agreed.

> but cmd.exe just
> plain has issues.

It's not cmd.exe, it's the terminal that is shit. You can't even 
interactively resize the width in the standard terminal.

> 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.
>
> One option would be to render the whole thing graphically, abandoning
> cmd.exe altogether. That would be how a lot of telnet and SSH clients
> will do the work. Get a proper Unicode-supporting toolkit (Tkinter has
> issues with astral characters too, AIUI), and yes, you'll have to do a
> lot of work yourself.

Tkinter only supports the BMP currently. But neither Polish nor box 
drawing does require more: All those box drawing symbols are in the BMP:

	http://www.unicode.org/charts/PDF/U2500.pdf

So you could use a Tkinter text widget and put your data there - or even 
a simple label would do.

	Christian



More information about the Python-list mailing list