wxPython and Unicode and widgets

> Chris Mellon

> Whats happening here is that you're pasting bytes in cp1252. The
> terminal you're pasting into (PyShell?) renders these bytes according
> to it's default encoding but what Python sees is the raw bytes.

The shell outputs I posted in my previous message are coming from
my Python shell, psi, http://spinecho.ifrance.com/psi.html

Why is it working so smoothly? Because in psi, the sys.stdout
pseudo file has an internal mechanism which will convert any
<unicode> to a <str> using the locale encoding and the 'replace'
flag (from there the question marks).

If I attempt to reproduce these commands in PyShell, the shell
will raise UnicodeEncode/DecodeError. Which is not wrong, too.

I do not claim my approach is good or better than one another.
I am quite satified with it.

I'm not sure how that is relevant to the discussion, then - you've got
a customized environment that suppresses errors, but that's obviously
not the best general case solution, and it's got nothing to do with
ascii vs unicode mode wxPython or support for cp1250 in python.

> I tried to show a DOS terminal session, but I can't actually copy and
> paste non-ascii characters from the terminal. Thanks, Microsoft :stuck_out_tongue:

Well, here this is not a question of ascii/non-ascii. The DOS box is
using (historical reason?) the code pages cp850 for Western European
systems and cp437 for US platform.

My terminal seems to be using cp1250, or at least it's consistent with
my tests in that direction. Regardless, my point is that while it can
and does display non-ascii characters, it won't copy them to the
clipboard.

ยทยทยท

On Dec 20, 2007 3:01 PM, jmf <jfauth@bluewin.ch> wrote: