Odi's astoundingly incomplete notes

New entries | Code

URL encoding in PHP

The list of flaws in PHP is neverending. My today's favourite is the PHP function urlencode. The flaw there: They are doing it wrong for non-ASCII characters.

STD-66 section 2.5 defines UTF-8 as the encoding to use for characters outside ASCII. RFC-2616 (HTTP) does not make any different definition. But the PHP function uses ISO-8869-1 as the encoding, which is just plain wrong.

posted on 2005-01-31 17:26 UTC in Code | 0 comments | permalink