I have a Codepage issue, and for now I am a bit stumpped

My original source data contains multiple country data delivered in SHP (UTF-8). The data is then merged into a File GeoDB as the data is too large for the 2gb SHP/DBF limit. Previously I was able to use the *.CPG method with a smaller SHP dataset to correctly display the data that contains caracters that matches ANSI (ê, ë, ô, etc.). Now that the data is in a File GeoDB I am not able to use this method.

Strangely enough, I changed the codepage of a smaller SHP-UTF8 data set to SHP-ANSI using a FME process, then imported the data into a File GeoDB and the data then displayed correctly in ArcMap.

Now transforming all the source SHP-UTF8 data to SHP-ANSI is quite a timely process (many files that makes up a big dataset), so my question is if it is possible to set or convert the CodePage of the data in a File GeoDB so that the merged dataset would display correct?

The UTF8 based data looks like this : Koöperasie Street

Where it should look like (ANSI): Koöperasie Street

3 Answers 3


This isn't much of an answer I'm afraid, but the File Geodatabase format expects UTF16 strings, so that might be the cause of your problem. The developer documents say:

In general wstring is used for all character parameters in the API. This implies that we are using wchar_t. But in addition to that, we are using UTF-16 encoded characters in the wchar array. Our contract is that the wstrings that we provide as output are always UTF-16 encoded characters, and we require that developers supply the same for input strings that they use in any API function call.

Quite what the solution is I'm not sure...


You mention that you are converting SHP-UTF8 to SHP-ANSI. Technically you only need to do a DBF-UTF8 to DBF-ANSI conversion. Perhaps by focusing on this problem you can save a lot of time.

If you have a copy of ArcPad (you can try the 20 minute evaluation) you can try the following steps:

  1. Start ArcPad with an empty map
  2. Add a Shapefile that's currently in UTF-8
  3. Press CTRL-ENTER to open the script window
  4. Copy and paste the script below and execute to change it to ANSI
  5. Close ArcPad

Below is the ArcPad VBScript that you need to paste into the Script window:

Sub ChangeCodePage(layer, newCodePage)
  Dim rs, origCodePage, i, fld, count
  layer.Editable = True
  Set rs = layer.Records
  origCodePage = rs.CodePage
  Console.Print "Changing code page from " & origCodePage & " to " & newCodePage
  If origCodePage = newCodePage Then
    Console.Print "Done"
    Exit Sub
  End If
  count = 0
  While not rs.EOF
    For i = 1 to rs.Fields.Count
      rs.CodePage = origCodePage
      fld = rs.Fields(i).value
      rs.CodePage = newCodePage
      rs.Fields(i).value = fld
    count = count + 1
  Console.Print count & " records converted"
End Sub

Call ChangeCodePage(Map.Layers(1), 1252)

I will recommend to change registry and set the dbf Default to UTF-8. See How To: Read and write shapefile and dBASE files encoded in various code pages

After this change, just export shapefile to file geodatabase. Everything will be fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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