Shapefile Encoding Sidecar
Maps & GPSCPG can specify Shapefile attribute encoding. Geometry and attributes live in SHP/DBF companions; CPG alone is not a map.
- Main use
- Describe the attribute table’s character encoding
- Data type
- Text data
All sections, questions and sources
Content reviewed: · Editor:Kai
Opening steps
Choose your environment or purpose to see its steps.
Menu labels and support vary by app, OS and version. Preserve the original before making changes.
Troubleshooting by symptom
- No map: obtain the geometry dataset.
- Garbled text: compare CPG declaration and DBF encoding.
- Encoding differs elsewhere: inspect GIS detection/settings.
- No CPG: ask the publisher rather than guessing.
Dataset with CPG → GeoPackage or another format
- Verify decoded attributes, then export a separate dataset.
- Reopen the output and check it against the preservation points in this guide before handoff.
Saving incorrectly decoded text can make corruption persistent.
A declaration does not transcode data
Changing CPG to UTF-8 does not transcode DBF bytes; use correct GIS read/write settings.
Source for these steps:GDAL · ESRI Shapefile / DBF / QGIS · General Tools — Styles
Worked example: checks before handoff
Example: inspect several municipality names before and after export.
Source for these steps:GDAL · ESRI Shapefile / DBF / QGIS · General Tools — Styles
Related-format differences
| Format / method | Purpose and preserved information |
|---|---|
| .cpg | Describe the attribute table’s character encoding |
| PRJ / DBF | Coordinate system / attribute payload. |
| Dataset with CPG → GeoPackage or another format | Saving incorrectly decoded text can make corruption persistent. |
Handling and security
Review attribute privacy before sharing.
Questions and answers
Is CPG alone a map?
It is encoding metadata.
Can it be discarded?
Retain it as part of the dataset.
Same as PRJ?
PRJ generally describes coordinates.
Format facts: name, steward and MIME type
- Formal name
- Shapefile Encoding Sidecar
- Steward / specification
- GDAL
- MIME type
- Consult the producer or delivery system. The extension alone does not establish a MIME type.
Primary and official sources
- Project documentationESRI Shapefile / DBF
CPG encoding and PRJ coordinate systems.
GDAL · Link checked: - Software documentationGeneral Tools — Styles
Saving and loading QML/SLD styles.
QGIS · Link checked: