views:

79

answers:

1

Hi All,

I'm be wild about some CZECH char. On DB I've saved strings with č (and similar chars) and I'm able to show this only if I set my page charset to ISO-8859-1.

It could be ok, but I've an UTF-8 XML file and when I try to get some string from this xml I've some problem. Basically the string from XML will not be shown correctly if I use ISO-8859-1 charset. The xml is UTF-8. I've tried to convert č and similiar char to š on xml and using ISO-8859-1 charset but they won't be shown correctly.

So. The situation is:

XML on UTF-8 and HTML Page with UTF-8, string from XML correct but string from DB not visible XML on ISO-8859-1 and HTML Page with UTF-8, string from XML not correct but string from DB correct

I've also tried to convert XML string with ICONV or similar funciont but nothing happens.

Could you help me, please?

Andrea

A: 

There are lots of functions that convert UTF8 to ISO-8859-1, including PHP's mb_convert_encoding. However I would strongly advise to use UTF8 where possible. Also, whenever a character question is asked, this article is a must-read.

Peter Kruithof
This page http://www.fornacigrigolin.it/slo/Home.php is ISO-8859-1 and the text title is UTF-8. With mb_convert_encoding($text, 'ISO-8859-1'); you can see the result. Page title is wrong(it has to be "Vodilna italianska firma izdelkov za gradbenižtvo")
Andrea Girardi