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.

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

Cheers.

Pieter

share|improve this question

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...

share|improve this answer

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
  rs.MoveFirst
  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
    Next
    rs.Update
    rs.MoveNext
    count = count + 1
  Wend
  Console.Print count & " records converted"
End Sub

Call ChangeCodePage(Map.Layers(1), 1252)
share|improve this answer

I will recommend to change registry and set the dbf Default to UTF-8. See this

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

share|improve this answer

Your Answer

 
discard

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.