[Qgis-user] QGIS Python Plugin Installer not UTF-8 aware?

Andreas Neumann a.neumann at carto.net
Mon Nov 17 22:56:01 PST 2008


Hi Borys,

Thank you for your detailed explanation of the problem. I can understand
it better now. And yes, I did not properly encode it with "u'...'" in the
first place.

Also, thank you for investigating whether we can use utf-8 in plugin
metadata in the future.

All the best,
Andreas


> Monday 17 of November 2008 11:59:00 Andreas Neumann napisa³(a):
>> It seems like the Python QGIS Plugin installer has problems displaying
>> UTF-8 characters.
>>
>> As an example I am using german umlauts in the plugin description which
>> is
>> not displayed correctly.
>>
>> I filed bug https://trac.osgeo.org/qgis/ticket/1405
>>
>> This may be related to https://trac.osgeo.org/qgis/changeset/9617 ?
>>
>> Thank you for having a look at this bug.
>>
>> Andreas
>
> Andreas, Installer seems to be ok. If you see wrong characters, probably
> your
> description is not unicoded. Check your __init__.py file, because probably
> you've wrote:
>
> def description():
>   return 'Danke schön'
>
> This string is recognized by Python as iso8859-1 (the encoding declaration
> in
> the first line of the file doesn't matter). If you want tu use unicode,
> you
> need to use the following code instead:
>
> def description():
>   return u'Danke schön'
>
>
> However... Installer do, but rest of QGIS doesn't support utf-8 in plugin
> metadata ;) So I suggest to use simple iso8859-1 strings now:
>
> # -*- coding: iso8859-1 -*-
> (...)
> def description():
>   return 'Danke schön'
> (...)
>
> And of course don't forget to save it in 8859-1.
>
> Regards,
> B.
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>


-- 
Andreas Neumann
Böschacherstrasse 6, CH-8624 Grüt/Gossau, Switzerland
Email: a.neumann at carto.net, Web:
* http://www.carto.net/ (Carto and SVG resources)
* http://www.carto.net/neumann/ (personal page)
* http://www.svgopen.org/ (SVG Open Conference)
* http://www.geofoto.ch/ (Georeferenced Photos of Switzerland)




More information about the Qgis-user mailing list