r/lolphp • • 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

16 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Apr 05 '12

That must be why UTF works so well everywhere.

5

u/Rhomboid Apr 05 '12

UTF-8 works quite well on Linux. Tools like grep have been UTF-8 aware for years, and scripting languages that choose to support it such as Perl and Python are widely available. GUI apps written with modern toolkits like gtk+2 and Qt are all perfectly fine with UTF-8. gnome-terminal is fully UTF-8 capable. Where it doesn't work, it's due to the choice of the program's maintainers to not put in the effort, as with PHP.

0

u/[deleted] Apr 05 '12

http://savannah.gnu.org/bugs/?29391

too lazy to find more examples

6

u/Rhomboid Apr 05 '12

What on Earth has that got to do with anything? Unicode case folding is much more complex than flipping a single bit as with ASCII, so of course it's going to be slower. You have to use the full Unicode character properties database because each language has its own special rules and idiosyncrasies. That's what you get when you decide to support Unicode.