Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Unicode (UTF-8) in C++ [duplicate]

Tags:

c++

unicode

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?

like image 900
segfault Avatar asked Jun 07 '10 20:06

segfault


2 Answers

Go read this first: The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)

like image 153
Bjarke Freund-Hansen Avatar answered Sep 28 '22 01:09

Bjarke Freund-Hansen


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.

Edit: This answer was referring to C++03. As noted, it doesn't apply any longer.

like image 36
Edward Strange Avatar answered Sep 28 '22 03:09

Edward Strange