Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't think std::string is fine. Yes, it stores bytes, and yes, UTF-8 is byte-oriented, but besides being a storage of bytes, std::string has nothing that is unicode code-point aware. You need external libraries like ICU for that.


Oh, std::string is very far from being perfect for sure and the almost non-existent Unicode support in the standard library is consistent with its general lack of features. As it the case in C++, you have to resort to 3rd party library for anything beyond the very basic. ICU is very good though. There is also boost.Locale which is more "modern" and utf8 oriented although less featurefull.

I was merely pointing out that saying that C++ has 8 string types is flatly wrong.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: