0

I need a platform independent way to convert from a string that is encoded with a windows codepage that I know the number of (and nothing else) to a unicode string and back. I thought that icu4c might be able to do that but I did not find the correct way to get a converter for a windows code page number. Can someone help me?

Tobias Langner
  • 10,634
  • 6
  • 46
  • 76

2 Answers2

1

ucnv_getStandardName("windows-57011", "WINDOWS", status) should return the standard name for some codepage 57011, then use ucnv_open. See http://demo.icu-project.org/icu-bin/convexp also

Steven R. Loomis
  • 4,228
  • 28
  • 39
0

I have a solution that gives me at least some converters. I copied the names from this page: http://msdn.microsoft.com/en-us/library/dd317756(VS.85).aspx into a table and use that to do a name look-up. Then I use this name to create the converter using ucnv_open. This works for most of the cpids mentioned on the page.

Tobias Langner
  • 10,634
  • 6
  • 46
  • 76