5 ms·
Found an error immediately "Any lowercase character" doesn't match all Swedish lowercase characters.
by nickez 1y ago
Found an error immediately "Any lowercase character" doesn't match all Swedish lowercase characters.
- iugtmkbdfil834 1y agoOk. This sounds like an interesting detour. Can you elaborate on that one? I doubt I will ever use that knowledge, but it sounds like it is worth knowing anyway.
- Tryk 1y agohttps://en.wikipedia.org/wiki/Swedish_alphabet https://en.wikipedia.org/wiki/Swedish_alphabet
- lalaithion 1y agoThe author says “any lowercase character” but they mean “any character between the character ‘a’ and the character ‘z’”, which happens to correspond to the lower case letters in English but doesn’t include ü, õ, ø, etc.
- comrade1234 1y agolol really? Why not? Is that true for all encodings? Is it a bug or a feature? What about a simple character set like gsm-7 Swedish?
- criddell 1y agoThe Swedish alphabet includes characters outside of the a-z range.
- lalaithion 1y agoThe author says “any lowercase character” but they mean “any character between the character ‘a’ and the character ‘z’”, which happens to correspond to the lower case letters in English but doesn’t include ü, õ, ø, etc.
- comrade1234 1y agoI would expect [a-z] to mean any lowercase in any language, not lowercase but only a to z. So I’d get bitten by that one.
- deciduously 1y agoThe letters with diacritics sort lexicographically after 'z', so it does stand to reason they wouldn't appear in that range.
- Someone 1y ago> but they mean “any character between the character ‘a’ and the character ‘z’”, which happens to correspond to the lower case letters in English ‘Only’ in the most commonly used character encodings. In EBCDIC (https://en.wikipedia.org/wiki/EBCDIC https://en.wikipedia.org/wiki/EBCDIC), the [a-z] range includes more than 26 characters. That’s one of the reasons POSIX has character classes (https://en.wikipedia.org/wiki/Regular_expression#Character_classes https://en.wikipedia.org/wiki/Regular_expression#Character_c...). [:lower:] always gets you the lowercase characters in the encoding that the program uses.