Possible Duplicate:
Unicode in C++
If I remembered correctly, the default character and string encoding in C++ are ASCII. Is there a simple way to enable Unicode support?
Possible Duplicate:
Unicode in C++
If I remembered correctly, the default character and string encoding in C++ are ASCII. Is there a simple way to enable Unicode support?
Depends on the version of C++ you are using. C++0x (not entirely released yet but still supported on many compilers) adds native UTF-8 support to the language. Otherwise, no the language does not support UTF-8. C++03 and earlier support unicode through the use of Wide Characters (wchar_t).
Current C++ doesn't specify encoding in any way. You might look into an actual Unicode library like ICU or, on some architectures and implementations you can use wchar_t to manipulate and hold Unicode strings.
It rather depends what you want to do with the text you are processing. Half the point of UTF-8 is that you don't need to change existing code if it handles 8-bit chars and does nothing special with characters above 128. Of course, strlen is the length in bytes rather than the character or code-point count. So it may be that you have a text in, text out program that can use UTF-8 directly. Or it may be that you're creating a GUI in text and so need to handle ruby and RTL text, in which case your job is much more complicated and you probably need to chose appropriate libraries.
If u are using Visual Studio then going into the project properties and defining a Preprocessor as _UNICODE does the job for u.
Go read this first: The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)