Re:A popular but wrong way to convert a string to uppercase ...
by zahlman on Tuesday October 08, 2024 @03:08PM
(#41780685)
I'm not seeing anything in the Swift documentation about strings carrying language metadata, either, though?
Re:A popular but wrong way to convert a string to uppercase ...
by kccqzy on Tuesday October 08, 2024 @03:20PM
(#41780805)
This lowercase function takes a locale argument https://developer.apple.com/documentation/foundation/nsstrin...
It looks like an old NSString method that's available in both Obj-C and Swift.
The casefold function is even older than that. https://developer.apple.com/documentation/foundation/nsstrin... Its documentation specifically includes a discussion of the Turkish İ/I issue.
> (No, Python can't turn 'SS' back into 'ß'. But doing that requires metadata about language that a string simply doesn't represent.)
Yes that's my point. Because in typical languages strings don't store language metadata, this is impossible to do correctly in general.