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

seg*_*ult 10 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?

Bja*_*sen 9

首先阅读:绝对最低每个软件开发人员,绝对必须知道Unicode和字符集(没有借口!)

  • 这很好地解释了什么是Unicode和UTF-8,但是我实际上如何在C ++中使用它呢?有没有办法,还是我会坚持使用字节字符串并自己处理编码? (3认同)

Edw*_*nge 6

当前的C++没有以任何方式指定编码.您可能会查看像ICU这样的实际Unicode库,或者在某些体系结构和实现中,您可以使用wchar_t来操作和保存Unicode字符串.

编辑:这个答案是指C++ 03.如上所述,它不再适用.

  • 它现在呢![(1)](https://en.wikipedia.org/wiki/C%2B%2B11#New_string_literals)| [(2)](/sf/ask/475731021/)| [(3)](http://en.cppreference.com/w/cpp/language/string_literal) (5认同)