3 ms·
Do random accents help verify that you're handling Unicode correctly? You don't know what it's supposed to look like, so how do you know you're displaying it c
by Groxx 14y ago
Do random accents help verify that you're handling Unicode correctly? You don't know what it's supposed to look like, so how do you know you're displaying it correctly?
- lesterman 14y agoRandom accents do help to make sure you're seeing proper encoding. The output of this site will look like junk if you encode it as UTF-8 and try to view it with any other encoding. Try it and see. Copy the output and paste it into a text document and save as UTF-8. In chrome, open that document and, under the View menu, choose a different encoding.
- rogerbinns 14y agoDid you try it? For example "Internationalization" becomes "Intèrnátìonàlïzâtiòn". If your code did anything bad to the unicode (eg decided codepoints are one byte, stripped high bit) then it would be very obvious. For my testing I also go to the wikipedia home page and copy the text in the middle of the page which lists how many articles there are in various languages. This is great because it uses a wide variety of code points, including ones greater than 0xffff.
- Groxx 14y agoI also see that "Intèrnátìonàlïzâtiòn" breaks in the middle, instead of considering it a word. Is that correct? It may be important for checking your layout. There are also no Asian scripts, nor taller / shorter characters that might overlap if your line spacing is too small.