pyshapelib branch

Bram de Greve bram.degreve at gmail.com
Wed Mar 14 01:15:02 CET 2007


I've looked a bit further into the issue and the Python documentation 
that the Unicode issue will not be resolved the way I've handled it.  It 
will try the default encoding (which is 'ascii') and thus fail as well.
The question of course is, what encoding should be used instead. utf-8?  
utf-16?

Bramz

Didrik Pinte wrote:
> Le mercredi 14 mars 2007 à 00:37 +0100, Bram de Greve a écrit :
>   
>> Can you specifically test for the Unicode issues.  The python
>> documentation says that Unicode should be supported by the methods
>> I've used, but if this is really true, I do not know (yet).  I haven't
>> tried =) 
>>     
>
> Concerning the unicode issue, the problem is more concerned by the
> dbflib than shapelib.
>
> When trying to open a file with a unicode name, I get the following
> error :
>
> An unhandled exception occurred:
> 'ascii' codec can't encode character u'\xe9' in position 23: ordinal not
> in range(128)
> (please report to http://thuban.intevation.org/bugtracker.html)
>
> Traceback (most recent call last):
>   File "/home/did/projets/python/thuban/bramz/Thuban/UI/mainwindow.py",
> line 297, in invoke_command
>     command.Execute(self.Context())
>   File
> "/home/did/projets/python/thuban/bramz/test/../Thuban/UI/command.py",
> line 121, in Execute
>     apply(self.function, (context,) + self.args + args, kw)
>   File "/home/did/projets/python/thuban/bramz/Thuban/UI/mainwindow.py",
> line 1071, in call_method
>     apply(getattr(context.mainwindow, methodname), args)
>   File "/home/did/projets/python/thuban/bramz/Thuban/UI/mainwindow.py",
> line 573, in AddLayer
>     store = self.application.Session().OpenShapefile(filename)
>   File
> "/home/did/projets/python/thuban/bramz/test/../Thuban/Model/session.py",
> line 296, in OpenShapefile
>     store = ShapefileStore(self, filename)
>   File
> "/home/did/projets/python/thuban/bramz/test/../Thuban/Model/data.py",
> line 201, in __init__
>     self.dbftable = table.DBFTable(filename)
>   File
> "/home/did/projets/python/thuban/bramz/test/../Thuban/Model/table.py",
> line 89, in __init__
>     self.dbf = dbflib.DBFFile(filename)
>   File "/home/did/projets/python/thuban/bramz/Thuban/../Lib/dbflib.py",
> line 5, in __init__
>     self.this = apply(dbflibc.new_DBFFile,args)
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in
> position 23: ordinal not in range(128)
>
> Didrik
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> Thuban-devel mailing list
> Thuban-devel at intevation.de
> https://intevation.de/mailman/listinfo/thuban-devel
>   




More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)