Won't start - win xp, cp1250, exception thrown
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
wxBanker |
Fix Released
|
Medium
|
Michael Rooney |
Bug Description
Deciding to see wxBanker work in windows, i installed python 2.6, wxPython 2.8 and downloaded wxBanker 0.4. It wouldn't start.
The exception being thrown:
File "E:\Program Files\Python2.
return codecs.
UnicodeDecodeError: 'charmap' codec can't decode byte 0x83 in position 13: character maps to <undefined>
I'm new to python and the string / unicode string madness is still not very clear to me, but changing the russian currency symbol assignment on line 181
from
self.LOCALECONV
to
self.LOCALECONV
in the utf-8 encoded currencies.py fixes the problem and the app will start.
The issue can be tested in Linux like this:
$ LANG=POSIX ./wxBanker.py
(this will complain about other bytes other than 0x83 specific to cp1250 encoding).
Related branches
Changed in wxbanker: | |
status: | In Progress → Fix Committed |
i guess it's simpler to prepend the 'u' marking unicode string in the currency symbol assignment like
self.LOCALECONV ['currency_ symbol' ] = '\xd1\x80\ xd1\x83\ xd0\xb1' ['currency_ symbol' ] = u'\xd1\ x80\xd1\ x83\xd0\ xb1'
into
self.LOCALECONV
still, wouldn't it be better to have utf-8 chars like 'руб' in the utf-8 encoded file ? or is there a problem with this ?