homepage Welcome to WebmasterWorld Guest from 54.205.106.111
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Content Encoding
UTF-8 encoding problem
Mareq




msg:615339
 2:36 pm on Jul 17, 2005 (gmt 0)

I am experiencing problem with UTF-8 encoding in document like this:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Site</title><link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
...
</body>
</html>

Browser and HTML validator, both detects windows-1250 encoding instead of utf-8, which is listed in headers. Could anybody help with this, plz?

 

encyclo




msg:615340
 7:25 pm on Jul 17, 2005 (gmt 0)

How are you saving your HTML files, Mareq? Many programs allow you to save your pages in UTF-8 encoding, but you will need to specify this in your program's preferences.

Windows programs like Notepad can be problematic in this regard as they usually save documents with the default Windows encoding (in your case, windows-1250). In Windows XP Notepad, you can specify UTF-8 but the files are prefixed with a byte order mark that can cause difficulties - best to use a proper UTF-8-capable text editor or wysiwyg program.

tschild




msg:615341
 7:41 pm on Jul 17, 2005 (gmt 0)

Browser and HTML validator, both detects windows-1250 encoding instead of utf-8

Did you test it with browser and HTML validator from your local disk, or after uploading to the Web server? If the latter, is there an encoding set for the HTTP headers?

g1smd




msg:615342
 11:00 am on Jul 18, 2005 (gmt 0)

Use a program like WebBug to see what is in the HTTP header.

Additionaly, REMOVE the trailing / from the meta tag (and from <hr>, <br>, <img>, and any other "single" tags), as that trailing / is only required in XHTML documents.

In HTML documents it can cause errors (for example: the first / seen after <head> is interpreted as being the </head> tag).

g1smd




msg:615343
 10:24 am on Jul 25, 2005 (gmt 0)


Did that fix it?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
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