C++ strings: UTF-8 or 16-bit encoding?

后端 未结 8 1600
广开言路
广开言路 2021-02-04 09:42

I\'m still trying to decide whether my (home) project should use UTF-8 strings (implemented in terms of std::string with additional UTF-8-specific functions when necessary) or s

8条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-04 10:30

    From what I've read, it's better to use a 16-bit encoding internally unless you're short on memory. It fits almost all living languages in one character

    I'd also look at ICU. If you're not going to be using certain STL features of strings, using the ICU string types might be better for you.

提交回复
热议问题