3 ms·
> For writing globally appropriate software, UTF-8 is the best option that exists in practice. OK, I lied. China doesn't use GB2312 anymore. They use its updat
by thaumasiotes 7y ago
> For writing globally appropriate software, UTF-8 is the best option that exists in practice.
OK, I lied. China doesn't use GB2312 anymore. They use its update, GB18030, which carries arbitrary Unicode data just as UTF-8 does... except that, like GB2312, it puts the Asian characters in two bytes and the European characters in three.
It's certainly not obvious to me that UTF-8 is better for globally appropriate software. It looks worse. Software for Europeans, sure.
- hsivonen 7y agoGB18030 has no 3-byte sequences. Only 1, 2, and 4. There are more important qualities than optimizing byte length. Processing GB18030 as Unicode scalar values involves lookup tables. A single byte error cascades potentially further than in UTF-8. If optimizing Chinese byte length is really important for you, UTF-16 is easier to work with than GB18030.