Skip to content
Novus Examples
cpg

What is a .cpg file?

text/plain

A .cpg file is a one-line sidecar naming the character encoding used by a shapefile's .dbf attribute table — typically UTF-8, or a legacy code page such as ISO-8859-1 or CP1252. The dBase format has no reliable in-band encoding declaration, so without this file a reader has to guess, and non-ASCII attribute values come back as mojibake.

How to use a .cpg file

Use an example .cpg file to test shapefile readers' encoding handling, confirming that the declared code page is applied to .dbf string fields and that a missing or contradictory .cpg is reported rather than silently guessed.

Convert a .cpg file to another format

← All file formats