I have a SHP file which have UTF8-encoded char fields. It also has a corresponding CPG file with the value 65001. The language byte (#29) in the DBF is currently 0.

How do I get it to keep the encoding in the output, when I use ogr2ogr to select a subset of the records? Output is also SHP. At the moment it changes it into $57 = codepage 1252.

  • Have you cpg file, cpg contains information about encoding? For example, if have you shapefile with encoding UTF-8, cpg file contains utf-8 string – Wenceslauw Jan 25 '17 at 6:31

Adding this as part of the command line, does the trick:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.