3 ms·
Yes, this usage of UTF-8 is limited to the ASCII subset.
by drostie 9y ago
Yes, this usage of UTF-8 is limited to the ASCII subset.
- chubot 9y agoRegarding the examples: " 0 " 1 # 42 Why is the length stored in base 92 while the number is stored in base 10? Why not just store them both in base 128 or 127 (if you want C strings)? You can't use base 256 because some strings won't be valid UTF-8, but base 127 or 128 seems fine. Do you want some notion of human readability? That isn't in the problem statement. Your problem statement seems fairly imprecise in a couple ways.
- drostie 9y agoI mean, I think a case can be made for something like it, where possibly one adds to the problem statement "the bytes should be contiguous ASCII and should not cause the JSON standard to backslash-encode the characters." The biggest range which does this is 0x23 to 0x5B inclusive. But that only gives 57 workable characters. If it helps, I am not the author of the original article.