Dabo Trac wrote:
> #1191: dabo uses utf-8 instead of cp1252 as default encoding on Windows
> ----------------------+-----------------------------------------------------
> Reporter: cito | Owner: somebody
> Type: defect | Status: new
> Priority: major | Milestone: 0.8.3
> Component: ui | Version: 0.8.4
> Keywords: encoding |
> ----------------------+-----------------------------------------------------
> The default encoding on Windows is actually cp1252, but dabo uses utf-8
> instead. Under Linux, the default encoding could also be something
> different, in which case the same problem appears here as well.
>
> This happens because dabo uses getlocale() to determine the default
> encoding (in several places), but getlocale() usually returns None and so
> dabo falls back to a hardcoded default of 'utf-8' which is not appropriate
> under Windows for example.
>
> Instead (or in addition, if getlocale() returns None), it may be better to
> use getdefaultlocale()or getpreferredencoding() which correctly returns
> 'cp1252' on Win.
>
I also have a problem with
in dApp.py
# ret = ret.decode(sys.getfilesystemencoding())
ret = "utf-8"
in lib/conParser.py
# pth = pth.decode(sys.getfilesystemencoding())
pth = "utf-8"
in db/dbSQLite.py
#pth = pth.decode(sys.getfilesystemencoding()).encode("utf-8")
pth = "utf-8"
The commented out line is the original Dabo line.
I have not created a patch file yet.
On SCO UNIX Openserver and UnixWare sys.getfilesystemencoding() returns None.
After working with SCO support None is valid for the standard underlying system
command that feeds the Python command. Python also agrees that None can be a
possible return. However in a lot of Python code I see no handling of the None
case.
In these 3 cases if sys.filesystemencoding() returns None it triggers a
traceback
on SCO Unix.
I will have time sometime tomorrow to put together a proposed proper patch that
will work
on SCO and shouldn't break other systems.
Thanks
Paul McNary
[email protected]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[email protected]