tags:

views:

100

answers:

1

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
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
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
I think it's fair to say that a language which has no concept of encoding doesn't support UTF-8. ;)
jalf
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