Re: utf-8 in $_POST

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have to ask... WHY are you forcing ISO-8859-1?  If anything, you should be 
forcing UTF-8.  Then you can send, receive, and store data in UTF-8 ad cover 
most human languages without having to change character set.  

On Monday 07 January 2008, Olav Mørkrid wrote:
> i specify iso-8859-1 in both header and body:
>
> <meta http-equiv="Content-type" content="text/html; charset=iso-8859-1"/>
> <form action="/" method="post" accept-charset="iso-8859-1">
>
> if two different people post the norwegian phrase "Godt nytt år"
> (happy new year), it may appear in the following variations:
>
> [CONTENT_TYPE] => application/x-www-form-urlencoded;charset=iso-8859-1
> $_POST["input"] = "Godt nytt år"
>
> [CONTENT_TYPE] => application/x-www-form-urlencoded;charset=utf-8
> $_POST["input"] = "Godt nytt år"
>
> i was just wondering if php had some setting or function that would
> make it auto-convert $_POST data into one specific encoding. otherwise
> i seem forced to do something like this in the beginning of my php
> script:
>
> if(ereg("utf-8", $_SERVER["CONTENT_TYPE"])) {
>   foreach($_POST as $key => $value)
>      $_POST["key"] = convert_utf8_to_iso8859($value);
> }


-- 
Larry Garfield			AIM: LOLG42
larry@xxxxxxxxxxxxxxxx		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux