homepage Welcome to WebmasterWorld Guest from 54.211.201.65
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Visit PubCon.com
Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
Forum Library, Charter, Moderators: phranque

Website Technology Issues Forum

    
UTF-8 characters showing up jumbled
bernk




msg:3883012
 11:15 am on Apr 1, 2009 (gmt 0)

Anyone have an idea why this is happening?

The file is using UTF-8 encoding, the meta tag sets the character set to UTF-8 too...but when I upload it to my client's server characters with umlauts (for example ü) don't display properly.

The document is XHTML 1.0 strict.

If I change the file encoding to ISO-8859-1 and the meta tag it works fine...why? On my local server it works either way...

 

rocknbil




msg:3883099
 2:30 pm on Apr 1, 2009 (gmt 0)

This might help clarify it for you . . . Character encoding, entity references and UTF-8 [webmasterworld.com]

bernk




msg:3886555
 6:15 pm on Apr 6, 2009 (gmt 0)

Thanks for the resource, however after reading it...and the comments, and some other referenced threads, I'm still having the same problem.


<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="no" lang="no">

<head>
<title>An XHTML 1.0 Strict standard template</title>
<meta http-equiv="content-type"
content="text/html;charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
</head>

<body>

<p>Flygande bäckasiner söka strax hwila på mjuka tuvor.</p>

</body>
</html>

That file is saved as UTF-8, and the accented characters are not displaying properly.

Is it possible that the server is forcing everything to display as ISO-8859-1?

rocknbil




msg:3887234
 3:41 pm on Apr 7, 2009 (gmt 0)

I can't answer that question, it's outside my arena. Hopefully someone will . . . my first guess is to say yes, as when I've encountered this I had my admin tweak something on the server and it went away.

You could try installing the FireFox extension Live HTTP Headers, and see what it says. For this site, I notice

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

And your characters are rendering fine here, so it appears this could be the case.

bernk




msg:3887246
 3:57 pm on Apr 7, 2009 (gmt 0)

Thanks for the suggestion, I'll check it out using Live Headers...

bernk




msg:3887311
 5:35 pm on Apr 7, 2009 (gmt 0)

The problem was indeed caused by the server having a default charset of ISO-8859-1. It was easily rectified using an .htaccess file with the following line:

AddDefaultCharset OFF

I hope this helps someone in the future. I should also point out that you should have the charset specified in each of your files if you are going to use AddDefaultCharset OFF. If you do not have a charset specified in each file you can use UTF-8 (or any other charset) instead of OFF.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved