News for hackers. Stuff that matters.
Re:Resetting PHP6 (or: Unicode claims another victim) by jrockway on Tuesday March 30, 2010 @12:31PM (#1229521)
One of the number one bugs in web apps is assuming that characters can just "flow through" your application, as the article claims is a common case. Sure, if everything is UTF-8, it might work. But the fun comes when some of your data is us-ascii, some is iso8859-1, and some is utf-8. Now treating your data like binary is going to result in a garbled web page. So don't do it; decode data from octets to characters when it comes in your program, manipulate internally as character strings, and encode characters to octets when you output your data. Text is not binary!

And if I were Zed Shaw, this is the part where I'd threaten to kill you if you don't meet my demands.

Re:Resetting PHP6 (or: Unicode claims another victim) by randallsquared on Tuesday March 30, 2010 @02:31PM (#1229812)
Actually, the real problem is mixing Windows-1252 and UTF-8, while working with tools that assume your Windows-1252 is really ISO-8859-1. ASCII, after all, is just a subset of UTF-8, so there's no handling required for it if you're already assuming UTF-8.