Convert a String In C++ To Upper Case

后端 未结 30 1539
一个人的身影
一个人的身影 2020-11-22 05:25

How could one convert a string to upper case. The examples I have found from googling only have to deal with chars.

30条回答
  •  逝去的感伤
    2020-11-22 05:52

    Do you have ASCII or International characters in strings?

    If it's the latter case, "uppercasing" is not that simple, and it depends on the used alphabet. There are bicameral and unicameral alphabets. Only bicameral alphabets have different characters for upper and lower case. Also, there are composite characters, like Latin capital letter 'DZ' (\u01F1 'DZ') which use the so called title case. This means that only the first character (D) gets changed.

    I suggest you look into ICU, and difference between Simple and Full Case Mappings. This might help:

    http://userguide.icu-project.org/transforms/casemappings

提交回复
热议问题