[Qgis-developer] QGIS, Shapefiles, default encoding

Bernd Vogelgesang bernd.vogelgesang at gmx.de
Tue Dec 20 03:45:23 PST 2016


Am 20.12.2016, 11:05 Uhr, schrieb Drexel Peter  
<Peter.Drexel at vorarlberg.at>:

>
> Hi,
>
> please, can anyone tell me what default encoding QGIS uses when loading  
> a Shapefile?
>
> In my QGIS 2.14.7 on Windows 7 64bit  „Ignore shapefile encoding  
> declaration“ is checked,
>
> so if I load a Shapefile with a corresponding utf-8-cpg-file using “drag  
> and drop” it is encoded as >‘system’ and the encoding is wrong (what  
> encoding is ‘system’?).
>
> If I load a Shapefile with a corresponding utf-8-cpg-file using “Add  
> Vector Layer” it is encoded as >‘utf-8’ and the encoding is fine.
>
> In both cases I can change the data source encoding in the properties  
> dialog.
>
>
> Is it possible to change the behavior of drag and drop to use utf-8
>
>
> If I uncheck „Ignore shapefile encoding declaration“
>
> and load the shapefile either using “Add Vector Layer” or drag and drop  
> the cpg-file is interpreted >correctly and the encoding is set to utf-8.
>
> But now I cannot change the data source encoding in the properties  
> dialog anymore.
>
> I think it should still be possible to change the encoding in the  
> properties dialog.
>
>
> Peter
>
>
>
Hi Peter,
welcome to the Babylon of computer stone age ;)

I think a lot of people share your confusion with codepages.
Your "system" encoding is that of your Windows, so presumably (in Western  
Europe) windows-1252 or CP1252 or ISO 8859-15.
On a Linux system, it is normally UTF-8.

I often run into problems with the encoding on my Linux system when  
dealing with files from Windows systems and vice versa.
Having files of mixed encodings in a project is a nightmare.
Those problems also seem to derive from files like gpx, kml etc. which  
always seem to be generated using UTF-8.
So even when I decide to handle everthing in Windows-style and convert  
files to windows-1252, those UTF-8 files bring in problems.
Same with the processing toolbox, where some algos happily switch the  
output encoding.

When unchecking „Ignore shapefile encoding declaration“, UTF-8 seems to be  
used internally (see https://hub.qgis.org/issues/11019).
But I have problems understanding all this, and worse, QGIS seems to not  
understand all this as well all the time.

P.s. Haven't touched ArcGIS for years. How does this handle different code  
pages in a project?



>>
>
>
>
>
>
>
>



-- 
Bernd Vogelgesang
Siedlerstraße 2
91083 Baiersdorf/Igelsdorf
Tel: 09133-825374
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20161220/57402c4a/attachment.html>


More information about the Qgis-developer mailing list