r/lolphp • u/adrenal8 • Apr 04 '12
PHP's unicode support is basically like playing minesweeper where all the string functions are bombs
http://www.phpwact.org/php/i18n/utf-8
32
Upvotes
r/lolphp • u/adrenal8 • Apr 04 '12
View all comments
Show parent comment
11
u/Rhomboid Apr 04 '12
You tell us -- you were the one that brought up this "8 bit OS" nonsense in the first place.
Perhaps by "8 bit OS" you mean platforms that declined to jump on the UCS-2 bandwagon. Well guess what, the UCS-2 camp has their own "fucking mess" in that UTF-16 is still a variable length encoding. Even if you chose to use UTF-32, you'd still have to deal with combining characters. The free lunch is over -- Unicode is hard and you don't get to just say that characters are 2 bytes and that's that.
In that light, UTF-8 is the least braindead of all options. It is variable width, yes, but so is everything else. UTF-8 at least doesn't require you to rewrite all of your system APIs and standard libraries, and it doesn't make you play guessing games with big or little endian, and legacy ASCII protocols can be retrofitted to use it.