From: Kevin A. <al...@se...> - 2004-11-07 18:11:26
|
On Nov 2, 2004, at 3:19 PM, Kevin Altis wrote: > On Nov 2, 2004, at 2:57 PM, Pat Smith wrote: > >> Hi >> I'm starting work on an application and I'd like to use PythonCard, >> but I was wondering whether or not it currently supports unicode, >> because in my tests, it does not. >> I have wxPython's unicode build installed in windows, and unicode is >> displayed properly in the wxPython Demo. However, when I attempt to >> build a resource file with unicode, it complains about ascii >> conversion. >> >> Any help you could offer would be greatly appreciated. >> >> Thanks. >> Patrick Smith > > http://sourceforge.net/tracker/index.php? > func=detail&aid=1036993&group_id=19015&atid=119015 > > Right now, there is specific code in resourceOutput.py that is > converting Unicode text to ascii. If those lines are commented out, I > think you'll be able to save Unicode strings to the resource file, but > what I don't know is whether some of those values saved will cause > PythonCard to gag when the resource files are loaded; probably not, > but I have no test cases to check. What you might try first, is > manually changing the 'text' or 'label' or other attributes where you > want to use Unicode strings and see if those load okay. > > There are at least two issues that need to be figured out with regards > to Unicode and PythonCard. One, is what attributes should support > Unicode strings. More importantly, if you have a resource file with > Unicode strings or use Unicode strings in your source and try and run > it on a non-Unicode build of wxPython, should PythonCard attempt to do > any conversions to ascii or just let an exception be thrown? This is > potentially a messy issue, but due to some limitations and bugs in the > wxPython builds, especially on Win9x, it isn't possible for us to just > require everyone to always run a wxPython Unicode build. > > What would be helpful, is to get some examples of real PythonCard > programs using Unicode in source and resource and then I would have > something to experiment with using both types of wxPython builds. All > files should be zipped and sent to me directly. > > ka This wiki page is relevent to anyone interested in this issue. http://wiki.wxpython.org/index.cgi/UnicodeBuild I'm also going to change tests for StringType to StringTypes in the framework, samples, and tools. So far, that looks like it will only impact multicolumnlist.py and the MultiColumnList sample, but there might be some tests for str elsewhere as well. Hopefully, that will make the code more Unicode-friendly once the explicit ascii checks are dealt with as well. http://docs.python.org/lib/module-types.html """ StringTypes A sequence containing StringType and UnicodeType used to facilitate easier checking for any string object. Using this is more portable than using a sequence of the two string types constructed elsewhere since it only contains UnicodeType if it has been built in the running version of Python. For example: isinstance(s, types.StringTypes). New in version 2.2. """ ka |