Been developing with UTF-8 and PHP for years - have yet to meet a problem doing 
so... The only let downs tend to be string manipulation (see iconv or mbstring 
to correct). Otherwise - no pain. The main condition to full support is having 
everything ELSE use UTF-8. That's the main mistake devs make - having some 
input or output mishandled as a different encoding, like HTML being served 
wrong, or actual files encoded as as ISO or even Windows encoding (largely an 
issue with Windows editors in general). I'm still surprised at the number of 
large (millions of users), everyday applications which cannot get that much 
right. It's really noticeable given my name has an accented Gaelic character.

Saying PHP has weak UTF-8 support is plain wrong.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative





________________________________
From: Nicolas Grevet <[email protected]>
To: [email protected]
Sent: Fri, February 5, 2010 3:20:57 PM
Subject: Re: [fw-general] encoding problem in ajax request

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.

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 :
> -- [email protected] <[email protected]> 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.

Reply via email to