3 ms·
Pretty sure all of Microsoft's own stuff is using UTF-16, so all characters take two bytes, regardless.
by moron4hire 7y ago
Pretty sure all of Microsoft's own stuff is using UTF-16, so all characters take two bytes, regardless.
- Dylan16807 7y agoIt's 64 kilobytes, more or less. Some characters are 2 bytes and some are 4. Also you can use invalid unicode. And when first implemented it was UCS-2.
- ChrisSD 7y agoIndeed. Although technically it's UCS-2 as the low level stuff doesn't understand modern unicode; it just treats it all as a stream of wide chars. It's up to applications to interpret it. According to this[0] the path limit is nearer 32739*2 bytes as a drive like "C:" gets expanded to "\Device\HarddiskVolume1". [0] https://stackoverflow.com/questions/15262110/what-happens-internally-when-a-file-path-exceeds-approx-32767-characters-in-win https://stackoverflow.com/questions/15262110/what-happens-in...
- connicpu 7y agoOnly characters from the Basic Multilingual Plane. If you put an emoji in a path, for example (allowed), it will be 4 bytes.
- ynik 7y agoExcept if it's a compound emoji, which takes multiple codepoints -> more than 4 bytes. So really the takeaway is that "character" is highly ambiguous nowadays and shouldn't be used anymore, use one of these instead: * UTF-n code unit * Unicode code point * Grapheme Cluster * Extended Grapheme Cluster For the latter one also needs to specify the version of Unicode they're talking about, since every new compound emojis changes the definition of "Extended Grapheme Cluster".