4 ms·
I had to convert some strings to Base85 some years ago to integrate with an ancient system. There's no way to support all the different character sets out there
by nullwasamistake 7y ago
I had to convert some strings to Base85 some years ago to integrate with an ancient system. There's no way to support all the different character sets out there "out of the box". Unless you want a crippled language you need to support access to raw values so people can write their own handler
- kuschku 7y agoWhat did you convert to Base85? The UTF-8 representation? The Unicode character ids, as 32-bit, appended after another (UTF-32)? The UTF-16 encoding? Big or Little Endian? Or with BOM? There are no raw values. The same string, used in Qt/C++ vs. stdlib/C++ results in different raw values, because it’s encoded and handled differently. The fact that you believe there is a single true "raw value" of a string already shows why it’s important to make this explicit, because your code will break if used in different environments, and definitely won’t return the correct result.