4

is there a simple, portable way (win32, linux at least) to convert UTF-16 to UTF-8 and back? Preferably using boost.

Thx for your help, Tobias

hippietrail
  • 15,848
  • 18
  • 99
  • 158
Tobias Langner
  • 10,634
  • 6
  • 46
  • 76

2 Answers2

2

Both libiconv and icu can do this.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
0

Well, if this is for academic purposes, you can convert to UTF-32 and then to UTF-8 or UTF-16. Unicode.org has a convenient PDF that contains a table of bit distributions for UTF-32, UTF-16, and UTF-8.

MSN
  • 53,214
  • 7
  • 75
  • 105