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.