Is there a way in c++ to convert from ö to o, or ß to s, in general from utf-8 to the corresponding char from ASCII ?
+1
A:
Standard C++ does not support UTF-8. I would suggest this library: http://utfcpp.sourceforge.net/
If you want to, maybe it is possible to use in-built POSIX or Windows functionality for this. But then it's not portable.
kotlinski
2010-10-14 16:33:37
every 8-bit char supports UTF-8. Win32 API sucks at UTF-8, but that's different from "c++ doesn't support UTF-8". C++ has no concept (except <locale> and facets) of character encoding, and often doesn't need it either...
rubenvb
2010-10-14 17:48:26
Certainly it is not impossible to handle UTF-8 using C++, but there is no language support for it. As opposed to e.g. C#, Python or Java.
kotlinski
2010-10-14 17:51:00
I think it's fair to say that a language which has no concept of encoding doesn't support UTF-8. ;)
jalf
2010-10-14 18:33:50
The implementation was needed on linux. iconv() was approx what i need, but it wasn't good enough. So i've create a table like ö->oe, ü->ue. And in time i will extend the table.
smaryus
2010-10-21 12:28:52