[GRASS-dev] [GRASS GIS] #1941: wxGUI fails with Japanese locale

GRASS GIS trac at osgeo.org
Thu Aug 22 07:27:31 PDT 2013


#1941: wxGUI fails with Japanese locale
----------------------+-----------------------------------------------------
 Reporter:  venkat    |       Owner:  grass-dev@…              
     Type:  defect    |      Status:  new                      
 Priority:  blocker   |   Milestone:  7.0.0                    
Component:  wxGUI     |     Version:  svn-trunk                
 Keywords:  wingrass  |    Platform:  MSWindows 7              
      Cpu:  x86-32    |  
----------------------+-----------------------------------------------------

Comment(by mlennert):

 Replying to [comment:6 improgrammer]:
 > I encounter similar problem.
 >
 > I suggest modifying the sementics of gtask.get_interface_description()
 to return xml in "utf-8" encoding. see attachment
 "patch_for_ticket_1941.patch".
 >
 > Rational:
 >  1. The following code segment in task.py and forms.py is too limited
 because ("cp936","cp932", etc) need similar converting:
 > {{{
 >     enc = locale.getdefaultlocale()[1]
 >     if enc and enc.lower() == "cp932":
 >         p = re.compile('encoding="' + enc + '"', re.IGNORECASE)
 >         tree = etree.fromstring(p.sub('encoding="utf-8"',
 >
 get_interface_description(name).decode(enc).encode("utf-8")))
 >     else:
 >         tree = etree.fromstring(get_interface_description(name))
 > }}}
 >  1. Any where the gtask.get_interface_description() is called, the
 "convert-to-utf8" is needed;
 >  1. Properly constructed interface description text is xml text with
 proper <?xml ... encoding="some-text-encoding"?> statement, extract text
 encoding schema from these xml text is more rational than extract enc from
 locale package.


 Can someone else working in a Japanese Windows environment test this patch
 ?

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/1941#comment:7>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list