[Qgis-user] URGENT* script qgis encoding utf8 toward latin1?

G. Allegri giohappy at gmail.com
Mon Jul 23 06:51:27 PDT 2012


>
> So that's why i wonder if it's possible to change in my script utf8
> encoding
> toward latin1 encoding?
>
>
I'm not an expert in the field but I suppose you can do it as far as you
have used characters that can be encoded in latin1.
If you have unicode strings you can convert them with:

.encode('latin-1')

i.e.:

>>> a = u"\u00E1"
>>> type(a)
<type 'unicode'>
>>> a.encode('utf-8')
'\xc3\xa1'
>>> a.encode('latin-1')
'\xe1'

giovanni
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20120723/1ef54efa/attachment.html>


More information about the Qgis-user mailing list