3 ms·
> […] characters that aren't in ASCII, like say Chinese, UTF-8 will consume much more storage than necessary. I don't think that's a problem in practice. Takin
by pornel 16y ago
> […] characters that aren't in ASCII, like say Chinese, UTF-8 will consume much more storage than necessary.
I don't think that's a problem in practice. Taking for example:
http://www.baidu.com/s?wd=%D0%C2+%CE%C5 http://www.baidu.com/s?wd=%D0%C2+%CE%C5
The page takes 37KB in GBK, 39KB in UTF-8 and 73KB in UTF-16! (UTF-16 doubles cost of HTML markup but only saves ⅓ in text)
Even in pure Chinese plain text UTF-16 doesn't win by much. I've tested some random article: 18KB in UTF-16, 25KB in UTF-8. It's down to 9.5KB vs 10KB after gzipping.
- jharsman 16y agoI'm not surprised it doesn't make much of a difference with HTML since the markup contains so much ASCII. But 25 vs 18 kB is almost 40%. That might not be insignificant depending on how much text you're storing. But it's a nitpick really, I just thought it he should have noted some of the disadvantages to UTF-8 as well.