On Apr 28, 2005, at 9:57 AM, Charles Hartman wrote:

I'm using Python 2.4.1 with wxPython 2.5.4.1 Unicode build. While tracking down messy little problems with string-vs-unicode stuff, I put some code like this in my app:
defEng = wx.GetDefaultPyEncoding()
print 'default encoding is %s' % defEng
If I run this from within the WingIDE debugger, I get
default encoding is mac-roman
If I run it from the command line, I get
default encoding is mac-roman
If I use py2app to build a standalone, I get
default encoding is utf-8


How come?

Because wx.GetDefaultPyEncoding() is weird. It should be returning 'ascii' (because that's python's default default encoding), but for some reason it is returning 'mac-roman'. However, py2app sets the default encoding to utf-8 because that's what the encoding of terminal/console/etc. are. and apparently wx's weird function is picking that up.


-bob

_______________________________________________
Pythonmac-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to