-- Nicolas Grevet <ngre...@alteo.fr> wrote
(on Friday, 05 February 2010, 04:20 PM +0100):
> If only the world was this beautiful, it would be great. When full
> UTF-8 support will be implemented in PHP and that more than a third
> of the language functions will supprot it, then we'll consider
> switching to UTF-8.

You're confusing utf-8 with unicode. They're very different. One is a
character set, the other an encoding. PHP currently handles UTF-8
strings fairly well - though you may need to use some of the iconv or
mbstring functions to do certain manipulations. PHP 6 will offer full
Unicode support, which will mean all string functions will be unicode
aware, and thus eliminate the need for special processing.

As for just passing strings to and from the database, or spitting them
out to HTML, support for utf-8 in current versions of PHP is fine, and
works well.

> The last project I had to develop with UTF-8, oh god... working with
> file imports, renamings, emails and such was a terrible pain in the
> back. So yeah, we all want to work full-utf-8, me first. But the
> language support is quite weak (until PHP 6).
> 
> Besides that, not everyone is allowed to decide wether he wants to
> work in a particular encoding or another... and there's much more to
> discuss in there.
> 
> 
> Matthew Weier O'Phinney a écrit :
> >-- i...@antoniocaccese.it <i...@antoniocaccese.it> wrote
> >(on Friday, 05 February 2010, 08:23 AM +0100):
> >>My problem is with ajax requests that must return html and not JSON.
> >>So, if i receive a string from POST like "La vita è bella" and save
> >>it into DB without apply utf8_decode i'll get a string like "La vita
> >>ù bella".
> >>
> >>I'm looking for an automatically method or best practise to deal with it.
> >
> >Your application should be using UTF-8 throughout -- that means all
> >files should be in utf-8, you should be declaring utf-8 as the charset
> >in your HTML headers and/or via meta tags, and your _database_ should be
> >using UTF-8 as its encoding. This will ensure consistency throughout all
> >aspects of your application and prevent exactly the issue you're
> >describing.
> 

-- 
Matthew Weier O'Phinney
Project Lead            | matt...@zend.com
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

Reply via email to