Re:A popular but wrong way to convert a string to uppercase ...
by account42 on Wednesday October 09, 2024 @08:44AM
(#41787314)
It's not guaranteed for 7-bit ASCII either because tolower/toupper are locale-dependent and with the tr_TR lowercase I (U+0049) is ı (U+0131, aka dotless i) wich encodes as two bytes in UTF-8.
[ Parent
| on HN ]
Re:A popular but wrong way to convert a string to uppercase ...
by squeaky-clean on Wednesday October 09, 2024 @09:02AM
(#41787482)
That's not ascii then. It's byte width compatible (to a certain degree as you point out). But it's not ascii. ascii defines 128 code points and the handling of an escape character. It doesn't handle locales.