Re[2]: Special chars & UTF-8: sometimes ok, sometimes wrong

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> I serve a UTF-8 header within my HTML, Apache is configured to serve
>> UTF-8 and PHP scripts are saved in UTF-8 charset.
>> However, this is a very odd issue, since it happens only with text
>> taken from DataBase, but not from texts written in scripts :(
>>
>> Any similar experience?

yes, it depends of the translation between tables and html pages.
I manage frequently standard configurations in Apache for Spanish
websites. On my view, it's better not changing the Apache
configuration. Instead that, be focused in having a latin_set 
characters in your Mysql tables, in example latin1_swedish_ci.

As a guide, when I open phpMyAdmin, I have my tables with
latin1_swedish_ci in where appears España. Then, having the HTML
pages with <meta http-equiv="content-type"
CONTENT="text/html;charset=utf-8"> it works without problems.

You can use use the PHP utf8_decode() function but it will be a hard
work for all variables in the whole site.
If you are now in a mess, I recommend you putting the Apache
configuration in the standard way. Restart, and load your HTML page,
changing the page codification using UTF and ISO-8859-1.
In this way, you can know what codification demands your HTML page to
show DB dates in a right way according the actual state of you tables.

If still you are not able to see the characters in any way,  then you
can export and re-import your tables choosing a latin1_set and then
problem will be solved using UTF-8 in the HTML pages.

But if you change Apache configuration, it can interfere with other
previous scripts or tables, I don't recommend you.
It is my experience.

Hope it helps,


Vicente,

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux