RE: [PHP] French character string encoding
| From: | Per Jessen | Date: | Thu, 24 Apr 2008 16:46:39 +0000 |
| Subject: | RE: [PHP] French character string encoding | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-273545@lists.php.net to get a copy of this message | ||
Angelo Zanetti wrote:
> Your � didn't display properly at all - I tried ISO-8859-1 and
> UTF8.
>
> /Per Jessen, Zürich
>
>
> Hi Per thats the problem I am having, this is how data from a project
> I inherited is saved in the DB and I cant get it to show.
Hi Angelo
what's the charset of your database table? Do e.g. "SHOW CREATE TABLE
xxxxx" in mysql to see what the table is stored as.
> However I get normal data eg: ème est très haute. To show if its saved
> like that in the DB, I just do:
>
> echo utf8_encode("ème est très haute.");
OK, all of that came through fine in ISO-8859-1 as quoted-printable.
And yes, if you to put that in a UTF-8 page, utf8_encode() would be the
right thing.
> and it works well. Is there anyway you think I can get the data in the
> DB to format correctly perhaps using some sort of string command?
Find out what charset the database is stored in - if it's ISO-8859-1 or
a close relative (which I suspect), you need to either serve your pages
as ISO-8859-1 or convert to UTF-8 using e.g. utf8_encode() and serve
the pages as UTF-8.
Have you got a sample I can look at? (feel free to send me URLs
off-line).
/Per Jessen, Zürich