4 ms·
UCS-2 length is also something that is still required today.
by blueflow 3y ago
UCS-2 length is also something that is still required today.
- tialaramex 3y agoUCS-2 is dead. You can't express Unicode in UCS-2. If you have old UCS-2 data you can just treat it as UTF-16, maybe check for encoding irregularities but if it was really UCS-2 correct Unicode it'll be fine. UTF-16 length is only useful if you are moving UTF-16, perhaps for interop with other software that chose UTF-16. Remember to pass on your condolences and look forward to a day when we don't do that any more.
- blueflow 3y agoUCS-2 support is shipped with every modern x86 firmware. UEFI system partitions use it for VFAT name encoding.
- lxgr 3y ago> UTF-16 length is only useful if you are moving UTF-16 [...] Remember to pass on your condolences and look forward to a day when we don't do that any more. Java/the JVM says hi! Arguably, "how many bytes does this string occupy in memory/on disk (e.g. in class files)" is a pretty useful thing to be able to ask.
- tialaramex 3y ago> Arguably, "how many bytes does this string occupy in memory/on disk (e.g. in class files)" is a pretty useful thing to be able to ask. Sure. On disk those strings are (modified) UTF-8 of course, is that what you meant ?
- lxgr 3y agoOn disk yes, at runtime it's still UTF-16, I believe. This is still relevant for many databases as well, as far as I remember.