Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Is there a way to determine the charset used for a given shapefile?

share|improve this question

3 Answers 3

up vote 8 down vote accepted

Trial and error. Try to open the .dbf file with Ms Excel or with OpenOffice using different setting until you get everything right.

Look at this post for more clues: http://stackoverflow.com/questions/319095/how-do-i-determine-the-character-set-of-a-string

share|improve this answer

There are two ways for programs to determinate the character set for a shapefile.

share|improve this answer
+1 That link to a dBase file format page is great. However, AFAIK, codepages were never included in the dBase III format. The reference there is to a FoxPro extension of the format, which suggests not all .dbf files are going to have codepage info in them (or, if they do, it might be a result of garbage bytes appearing in a free area of the header). But if you can dig this information out, it's still a good start for a trial-and-error search. BTW, welcome to our site! –  whuber Jul 20 '11 at 13:33
Some python dbf libraries can read the codepage if information is there. –  Paulo Scardine Aug 6 '12 at 19:19

Another table for converting 29th byte of *.dbf to code page: http://webhelp.esri.com/arcpad/8.0/referenceguide/index.htm#locales/task_code.htm

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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