Re: utf-8 in $_POST

From: Date: Tue, 08 Jan 2008 09:57:45 +0000
Subject: Re: utf-8 in $_POST
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-266870@lists.php.net to get a copy of this message
To author: You'r going the wrong way. Make your page utf-8, all text on it. Set utf-8 encoding and treat all incoming data as UTF-8. If some agent (definetly not some browser - they all know UTF-8) doesn't understand that (that could be some "hacker" writing it's own bot) - that's his problem. Then you will get all data incoming in utf-8 and you can just add, modify and select it in and from database (don't forget to set database and tables to UTF-8, that is default in MySQL 4.1 and above). If you have to deal with utf-8 data, you need the mb_string extension, see manual.

« previous php.general (#266870) next »