Shapefile with file .cpg(codepage)

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Shapefile with file .cpg(codepage)

Andrea Peri
Hi,
I have some shapefiles with an extra file having extension .cpg.
The .cpg extension is a optional extension for declaration of Code-Page.
Is this file knowed and supported from QGIS 2.14. ?

I don't know if the qgis when loading a shapefile is using the ogr or
instead is using an own shapefile provider, but however I don't know
if gdal is knowing and using this .cpg file.
:)


Thx,

--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Shapefile with file .cpg(codepage)

Burghardt.Scholle
Hi,
I would say that QGIS does not use the .cpg file. But you have the possibility to make the correct encoding in the layer properties under "General -> Layer info -> Data source encoding".

Regards
Burghardt


> -----Ursprüngliche Nachricht-----
> Von: Qgis-user [mailto:[hidden email]] Im Auftrag von
> Andrea Peri
> Gesendet: Donnerstag, 7. Juli 2016 12:16
> An: qgis-user
> Betreff: [Qgis-user] Shapefile with file .cpg(codepage)
>
> Hi,
> I have some shapefiles with an extra file having extension .cpg.
> The .cpg extension is a optional extension for declaration of Code-Page.
> Is this file knowed and supported from QGIS 2.14. ?
>
> I don't know if the qgis when loading a shapefile is using the ogr or instead is
> using an own shapefile provider, but however I don't know if gdal is knowing
> and using this .cpg file.
> :)
>
>
> Thx,
>
> --
> -----------------
> Andrea Peri
> . . . . . . . . .
> qwerty àèìòù
> -----------------
> _______________________________________________
> Qgis-user mailing list
> [hidden email]
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Shapefile with file .cpg(codepage)

Andreas Neumann-4

Hi,

QGIS is using OGR to read/write shapefiles.

http://www.gdal.org/drv_shapefile.html does not mention the .cpg files, so I assume, OGR does not support them. If you want to see this addressed, I would contact the GDAL/OGR devs.

Andreas

On 2016-07-07 12:46, [hidden email] wrote:

Hi,
I would say that QGIS does not use the .cpg file. But you have the possibility to make the correct encoding in the layer properties under "General -> Layer info -> Data source encoding".

Regards
Burghardt


-----Ursprüngliche Nachricht-----
Von: Qgis-user [mailto:[hidden email]] Im Auftrag von
Andrea Peri
Gesendet: Donnerstag, 7. Juli 2016 12:16
An: qgis-user
Betreff: [Qgis-user] Shapefile with file .cpg(codepage)

Hi,
I have some shapefiles with an extra file having extension .cpg.
The .cpg extension is a optional extension for declaration of Code-Page.
Is this file knowed and supported from QGIS 2.14. ?

I don't know if the qgis when loading a shapefile is using the ogr or instead is
using an own shapefile provider, but however I don't know if gdal is knowing
and using this .cpg file.
:)


Thx,

--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

 

 

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Shapefile with file .cpg(codepage)

Even Rouault-2
In reply to this post by Andrea Peri
Le jeudi 07 juillet 2016 12:16:17, Andrea Peri a écrit :
> Hi,
> I have some shapefiles with an extra file having extension .cpg.
> The .cpg extension is a optional extension for declaration of Code-Page.
> Is this file knowed and supported from QGIS 2.14. ?
>
> I don't know if the qgis when loading a shapefile is using the ogr or
> instead is using an own shapefile provider, but however I don't know
> if gdal is knowing and using this .cpg file.

Andrea,

OGR does use the .cpg file when present (I'm just updating
http://gdal.org/drv_shapefile.html since it only mentions the reading of the
codepage byte in the DBF header, but the .cpg presence overrides that) and
QGIS uses OGR to read shapefiles.

But, in QGIS, the default behaviour is to make OGR *not* use the encoding
detected by the OGR shapefile driver and use instead the user defined encoding
in the GUI. Unless you go to Settings / Options / Data Sources and uncheck the
"Ignore shapefile encoding declaration", in which case OGR will manage the
transcoding itself.

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Shapefile with file .cpg(codepage)

berndv.
Hi Even,

the encoding is often a source of confusion. I work in a mixed  
environment, me on Linux (so UTF-8 is the "System"-default), the rest is  
using on Windows (with Windows-1252 I assume)
Transfering shapes often results in crippled data, and I have not found  
workflows/settings that this will not happen.

Is there anything I can do about it, so we do not have to adjust things  
manually all the time, or first look if the codepage is correctly set ?

Cheers
Bernd

Am 07.07.2016, 12:58 Uhr, schrieb Even Rouault  
<[hidden email]>:

> Le jeudi 07 juillet 2016 12:16:17, Andrea Peri a écrit :
>> Hi,
>> I have some shapefiles with an extra file having extension .cpg.
>> The .cpg extension is a optional extension for declaration of Code-Page.
>> Is this file knowed and supported from QGIS 2.14. ?
>>
>> I don't know if the qgis when loading a shapefile is using the ogr or
>> instead is using an own shapefile provider, but however I don't know
>> if gdal is knowing and using this .cpg file.
>
> Andrea,
>
> OGR does use the .cpg file when present (I'm just updating
> http://gdal.org/drv_shapefile.html since it only mentions the reading of  
> the
> codepage byte in the DBF header, but the .cpg presence overrides that)  
> and
> QGIS uses OGR to read shapefiles.
>
> But, in QGIS, the default behaviour is to make OGR *not* use the encoding
> detected by the OGR shapefile driver and use instead the user defined  
> encoding
> in the GUI. Unless you go to Settings / Options / Data Sources and  
> uncheck the
> "Ignore shapefile encoding declaration", in which case OGR will manage  
> the
> transcoding itself.
>
> Even
>


--
Bernd Vogelgesang
Siedlerstraße 2
91083 Baiersdorf/Igelsdorf
Tel: 09133-825374
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Shapefile with file .cpg(codepage)

Claas Leiner-2
In reply to this post by Burghardt.Scholle
Hi,

QGIS uses the .cpg file when you deselect the Option  "Ignore shapefile
encoding declaration"

You find it:
Settings > Options >  Data Sources

Then there are no encoding-problems tu use QGIS with Shapefiles in in a
mixed environment.

Cheers

Claas


--
-----------------------------------------
GKG-Kassel - Dr.-Ing. Claas Leiner
QGIS-Support und mehr

Geodatenservice, Kartenwerkstatt &
GIS-Schule Kassel

Wilhelmshöher Allee 304 E
34131 Kassel
Tel. 0561/56013445
[hidden email]
http://www.gkg-kassel.de
----------------------------------------
Unterstützen Sie QGIS
QGIS-DE e.V. | http://qgis.de
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Shapefile with file .cpg(codepage)

Andreas Neumann-4

Hi,

I wonder why this is not the default? If a .cpg file is present, one can assume that the information is correct. Probably in some edge cases it may be false, but in the majority I assume the .cpg files to contain correct information.

Andreas

On 2016-07-07 16:17, Claas Leiner wrote:

Hi,

QGIS uses the .cpg file when you deselect the Option  "Ignore shapefile encoding declaration"

You find it:
Settings > Options >  Data Sources

Then there are no encoding-problems tu use QGIS with Shapefiles in in a mixed environment.

Cheers

Claas


-- 
-----------------------------------------
GKG-Kassel - Dr.-Ing. Claas Leiner
QGIS-Support und mehr

Geodatenservice, Kartenwerkstatt &
GIS-Schule Kassel

Wilhelmshöher Allee 304 E
34131 Kassel
Tel. 0561/56013445
[hidden email]
http://www.gkg-kassel.de
----------------------------------------
Unterstützen Sie QGIS
QGIS-DE e.V. | http://qgis.de
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

 

 

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Shapefile with file .cpg(codepage)

Burghardt.Scholle
In reply to this post by Claas Leiner-2
Hi Claas,

this is a very useful hint, which I didn't know yet. Thank you very much.

Regards
Burghardt

> -----Ursprüngliche Nachricht-----
> Von: Qgis-user [mailto:[hidden email]] Im Auftrag von
> Claas Leiner
> Gesendet: Donnerstag, 7. Juli 2016 16:17
> An: [hidden email]
> Betreff: Re: [Qgis-user] Shapefile with file .cpg(codepage)
>
> Hi,
>
> QGIS uses the .cpg file when you deselect the Option  "Ignore shapefile
> encoding declaration"
>
> You find it:
> Settings > Options >  Data Sources
>
> Then there are no encoding-problems tu use QGIS with Shapefiles in in a
> mixed environment.
>
> Cheers
>
> Claas
>
>
> --
> -----------------------------------------
> GKG-Kassel - Dr.-Ing. Claas Leiner
> QGIS-Support und mehr
>
> Geodatenservice, Kartenwerkstatt &
> GIS-Schule Kassel
>
> Wilhelmshöher Allee 304 E
> 34131 Kassel
> Tel. 0561/56013445
> [hidden email]
> http://www.gkg-kassel.de
> ----------------------------------------
> Unterstützen Sie QGIS
> QGIS-DE e.V. | http://qgis.de
> _______________________________________________
> Qgis-user mailing list
> [hidden email]
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user