[GRASS-dev] Re: [GRASS GIS] #882: i18n enabled winGRASS: properties dialog not opening
GRASS GIS
trac at osgeo.org
Wed Jan 20 01:18:55 EST 2010
#882: i18n enabled winGRASS: properties dialog not opening
---------------------------+------------------------------------------------
Reporter: neteler | Owner: grass-dev at lists.osgeo.org
Type: defect | Status: new
Priority: blocker | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Resolution: | Keywords:
Platform: MSWindows XP | Cpu: x86-32
---------------------------+------------------------------------------------
Comment (by glynn):
Replying to [comment:3 neteler]:
> I just discovered that in the terminal some problems are indicated:
{{{
SAXParseException
:
<unknown>:1:30: unknown encoding
}}}
>
> Maybe that gives an idea.
Look at the first line of the output from `d.rast --interface-
description`. The encoding= parameter is probably something Windows-
specific like "CP932". In which case, we may need to use something other
than locale_charset() (e.g. bind_textdomain_codeset() with NULL for the
codeset parameter), or even convert the text to UTF-8.
Except ... GUI.!ParseCommand() assumes that the text is in the locale's
encoding and is explicitly converting it to UTF-8. But it doesn't change
the encoding= in the XML header, which will still contain the locale's
encoding (maybe this pre-dates r17034 being back-ported?).
The fact that it's xml.sax.parseString() which is failing rather than the
".decode(enc)" in the argument suggests that Python understands the
encoding, so it may suffice to do something like:
{{{
- ... .decode(enc).encode("utf-8") ...
+ ... .decode(enc).split('\n',1)[1].replace('', '<?xml version="1.0"
encoding="utf-8"?>\n', 1).encode("utf-8") ...
}}}
The situation is complicated by the fact that 6.5/7.0 has abandoned
xml.sax in favour of xml.etree.!ElementTree.
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/882#comment:4>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list