Re: [PHP] Re: languages and PHP
- From: evermillion@xxxxxxxxxxxx (Edward Vermillion)
- Date: Thu, 27 Sep 2007 13:41:08 -0500
On Sep 27, 2007, at 10:09 AM, Colin Guthrie wrote:
Per Jessen wrote:David Christopher Zentgraf wrote:
Your biggest problem will be if you accept any kind of user input
which could be in any kind of language.
Depending on your server configuration you'll probably have some
serious cleaning and filtering to do.
I often have to employ this line for example:
foreach (array_keys($_POST) as $key) $clean[$key] =
mb_convert_encoding($_POST[$key], "UTF-8");
Trying to make sure that you'll receive UTF-8 helps as well:
<form action="form.php" method="post" enctype="multipart/form-data"
accept-charset="utf-8">
I work almost exclusively in UTF-8 (language irrelevant), but I've never
had to do any of the above. The mb_convert_encoding() from UTF-8 to
UTF-8 doesn't seem to make much sense?
I agree. Provided you HTML is dished out with UTF-8 in the doctype
definiton etc. then all forms are automatically sent in UTF-8....
But what happens if you get data that's *not* UTF-8? Just because your html/form is set to UTF-8 doesn't mean that all your incoming data will be UTF-8.
Ed
.
- Follow-Ups:
- Re: [PHP] Re: languages and PHP
- From: mike
- Re: [PHP] Re: languages and PHP
- From: Per Jessen
- Re: [PHP] Re: languages and PHP
- References:
- languages and PHP
- From: Angelo Zanetti
- Re: [PHP] languages and PHP
- From: David Christopher Zentgraf
- Re: [PHP] languages and PHP
- From: Per Jessen
- Re: languages and PHP
- From: Colin Guthrie
- languages and PHP
- Prev by Date: Re: [PHP] Re: PDOStatement execute memory issue?
- Next by Date: Re: [PHP] Re: languages and PHP
- Previous by thread: Re: languages and PHP
- Next by thread: Re: [PHP] Re: languages and PHP
- Index(es):