How to uppercase/lowercase UTF-8 characters in C++?

后端 未结 4 2110
野性不改
野性不改 2021-02-19 09:59

Let\'s imagine I have a UTF-8 encoded std::string containing the following:

óó

and I\'d like to convert it to the following:

<

4条回答
  •  日久生厌
    2021-02-19 10:26

    There is no standard way to do Unicode case conversion in C++. There are ways that work on some C++ implementations, but the standard doesn't require them to.

    If you want guaranteed Unicode case conversion, you will need to use a library like ICU or Boost.Locale (aka: ICU with a more C++-like interface).

提交回复
热议问题