I have the following in a file: Příšerně žluťoučký kůň úpěl ďábelské ódy When I print it out using (PHP) htmlspecialchars(utf8_decode($line), ENT_QUOTES) I get: P?�?ern? ?lu?ou?k� k?? �p?l ?�belsk� �dy Can anyone help me so that it will display correctly?
Do you have a !DOCTYPE line at the start of your document? Perhaps the browser is using a different encoding table and you need to specify the correct one.
What are you trying to get? I've not used that particular combination of functions. I did this <?php $str = "Příšerně žluťoučký kůň úpěl ďábelské ódy echo $str . "<br /><br />"; echo htmlspecialchars($str) . "<br /><br />"; echo htmlspecialchars_decode($str); ?> Code (markup): which renders this in the browser PÅ™ÃÅ¡ernÄ› žluÅ¥ouÄký kůň úpÄ›l Äábelské ódy Příšerně žluťoučký kůň úpěl ďábelské ódy PÅ™ÃÅ¡ernÄ› žluÅ¥ouÄký kůň úpÄ›l Äábelské ódy Code (markup): But, my server has this for the response header I think rb3m is on the right track. What response header does your server produce? The default is likely no charset, ASCII or iso-8859-1, depending on the server, its age and its administrator. Apache now defaults to iso-8859-1. Few if any browsers pay much attention to the http-equiv tag's charset. You'd best ask your web server admin to specify utf-8 or add "AddDefaultCharset utf-8" to your .htaccess file. cheers, gary