Discussion: utf-8 in $_POST
Afficher un message
Vieux 07/01/2008, 16h56   #2
pobox@verysmall.org
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] utf-8 in $_POST

Olav Mørkrid wrote:
> hello
>
> does php have any built-in functions to convert post data from
> whatever format it arrives in to whatever format i wish?
>
> example:
>
> i use iso-8859-1 internally, and even specify
> accept-charset=iso-8859-1 in my html, but some browsers (phones) send
> utf-8 anyway.
>
> do i have to manually check if CONTENT_TYPE says "utf-8" and then
> convert the $_POST array elements one by one, or does php have any
> built-in functions to ease this?


That's interesting question.

Do you generate the pages, respectively do you specify something like this -

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

My experience is that this does not affect only the displayed
characters, but the way the form fields are transported.

But perhaps I am wrong,
Iv
  Réponse avec citation
 
Page generated in 0,04597 seconds with 9 queries