Font encoding problems under Windows & Linux

If I try to run my application under Windows, I need to
decode each string, that is passed to wxPython widgets if the
string contains non-ASCII characters. In fact, this string is
encoded in CP1250 (Windows Central European, default for
my locale).
When I try to run the same application under Linux and the
strings are again encoded in default encoding (ISO-8859-2 in
this case,) and again contain non-ASCII characters, wxPython
is happy with it and displays them properly. Even more -
trying to decode these strings causes wxPython to show some
strange characters.
Shouldn't this behaviour be identical on each platform?

Jarek Zgoda wrote:

If I try to run my application under Windows, I need to decode each string, that is passed to wxPython widgets if the string contains non-ASCII characters. In fact, this string is encoded in CP1250 (Windows Central European, default for my locale).
When I try to run the same application under Linux and the strings are again encoded in default encoding (ISO-8859-2 in this case,) and again contain non-ASCII characters, wxPython is happy with it and displays them properly. Even more - trying to decode these strings causes wxPython to show some strange characters.
Shouldn't this behaviour be identical on each platform?

It is up to the platform to to determine how it behaves with strings with encodings, however I would expect windows to also behave properly if the strings are using the same encoding as the system locale... Perhaps there is some system setting that is not set correctly?

P.S. Being a mono-lingual American I am really stupid in this area, so I may be missing something obvious...

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Jarek Zgoda wrote:

If I try to run my application under Windows, I need to decode each string, that is passed to wxPython widgets if the string contains non-ASCII characters. In fact, this string is encoded in CP1250 (Windows Central European, default for my locale).
When I try to run the same application under Linux and the strings are again encoded in default encoding (ISO-8859-2 in this case,) and again contain non-ASCII characters, wxPython is happy with it and displays them properly. Even more - trying to decode these strings causes wxPython to show some strange characters.

Hello,

  I don't know wether this helps you, but it's worth to try: My applications are developed and tested under linux, and most of them run on win98. At the begining of these scripts the following lines are inserted:

reload(sys)
sys.setdefaultencoding('iso-8859-2')

Futhermore I think iso-8859-2 codepage should be preferred everywhere (even in wnxx environment, too). I haven't met this encoding problem, but many of non-ascii characters are used in various wxPython widgets. These ones needn't to 'encode' and displayed in the same way in different platforms.

  Best regards,

    Peter