Re:In the Turkish locale, "INFO".lower() != "info"
by neeeeees on Sunday August 16, 2020 @08:24PM
(#24182579)
I may be missing something - why is tolower(c) incorrect here?
[ Parent
| on HN ]
Re:In the Turkish locale, "INFO".lower() != "info"
by kentonv on Sunday August 16, 2020 @08:30PM
(#24182613)
Because if `c` is the letter 'I', and the current locale happens to be set to Turkish, then `tolower(c)` will return 'ı', not 'i'. If you are trying to lower-case an HTTP header name for the purpose of case-insensitive comparison, this is definitely not what you wanted. (And similar problems exist with several other locales; it's not just Turkish.)