Menu

#33 ResourceEditor is not unicode-safe

open
nobody
None
5
2004-09-29
2004-09-29
Erno Rigo
No

Hello!

PythonCard is the best python gui solution "on the
market" imho, but the lack of decent multilingual support
is missing from at least the resource editor application: it
looses every accented character typed in the property
editor so i have to manually edit the rsrc file afterwards
and convert the strings to unicode (the editor reads back
the file containing unicode strings with no problems, but
the chars are lost during the save process). This can be a
big problem during the update of an existing gui.

Discussion

  • Kevin Altis

    Kevin Altis - 2004-09-29

    Logged In: YES
    user_id=228025

    Thanks for the report. I assume that the problem is with the
    resourceOutput.py module, but the propertyEditor.py module may also
    have some issues. In particular, look at line 91 in resourceEditor/
    modules/resoureOutput.py

    # KEA 2002-07-07
    # what other Unicode strings do we need to deal with above?
    #print key, value, type(value)
    if isinstance(value, (str, unicode)):
    if isinstance(value, unicode):
    value = value.encode('ascii', 'ignore')

     
  • Erno Rigo

    Erno Rigo - 2004-09-30

    Logged In: YES
    user_id=1027085

    Commenting out these two lines resolved my problem:

    if isinstance(value, unicode):
    value = value.encode('ascii', 'ignore')

    The question is: what other functions had i messed up with this
    change? As for now i cannot see any.

     
  • Erno Rigo

    Erno Rigo - 2004-09-30

    Logged In: YES
    user_id=1027085

    Oh i see. I am using wxWindows unicode build. This is perfectly
    ok, but if i would switch to the non-unicode build, i expect i
    would get tons of exceptions.

    This is not a problem for me and after all everyone should use
    the wx unicode build, i see no reason in doing otherwise. I
    think back in 2002 this was an issue, but now it is not.

     
  • Nobody/Anonymous

    Logged In: NO

    It seems that wxWidgets only support unicode on Windows
    platforms, so...

    Can you detect whether the underlying wxPython is a unicode
    build? If no, just mention it in the document is ok for me,
    marking two lines in the source is easy.

    Or maybe
    import sys
    if sys.getdefaultencoding() == 'ascii':
    if isinstance(value, unicode):
    value = value.encode('ascii', 'ignore')
    will do.

     
  • Nobody/Anonymous

    Logged In: NO

    I noticed the same problem too with the latest version of
    PythonCard for Windows, at least for buttons and textfields.
    It doesn't appear to affect menu items though. Will try
    commenting out the two lines as suggested by b5sg33.

    Sani Woi (saniwoi at gmail.com)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.