4 ms·
Something I always thought was so neat about ASCII was that upper to lowercase was just a flip of the sixth bit away. Now I'm curious was that process is for Un
by jjice 3y ago
Something I always thought was so neat about ASCII was that upper to lowercase was just a flip of the sixth bit away. Now I'm curious was that process is for Unicode or more specifically UTF-8. Is it all table look ups?
- Macha 3y agoYes, but even in the era of ANSI code pages, it was that way for many "accented" characters and non Latin alphabets. And you still needed a little more in ASCII than blindly flipping bits or you'd turn your numerals into control characters.
- jlokier 3y agoOutside of English, upper and lower case isn't that simple. Consider German. Lower case letter "ß" was converted to two upper case letters, "SS" or "SZ", until fairly recently, when a new character "ẞ" was officially added. Much software still uppercases "ß" to "SS". For example: $ python3 -c 'print("große".upper())' GROSSE Consider Turkish. Upper case letter "I" converts to lower case "i" in English, but in Turkish the same letter converts to lower case "ı" (no dot). Lower case letter "i" converts to upper case "I" in English, but in Turkish the same letter converts to upper case "İ" (with a dot). So you have to know which language you're using. It's not enough to know the character. https://en.wikipedia.org/wiki/ß https://en.wikipedia.org/wiki/ß https://en.wikipedia.org/wiki/Dotted_and_dotless_I_in_computing https://en.wikipedia.org/wiki/Dotted_and_dotless_I_in_comput...