Re: utf-8 in $_POST

From: Date: Tue, 08 Jan 2008 18:31:14 +0000
Subject: Re: utf-8 in $_POST
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-266901@lists.php.net to get a copy of this message
At 11:57 AM +0200 1/8/08, Arvids Godjuks wrote:
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.
Good advice. Last night I read a chapter in the book "Core Web Application Development with PHP and MYSQL" by Wandschneider who said basically that -- a good read, btw. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#266901) next »