INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

HTML5 character encoding problem

HTML5 character encoding problem

(OP)

I am trying (really only as an intelectual exercise) to convert my website (pdavis.nl) from HTML4 to HTML5. Although I include <!DOCTYPE html> and <meta charset=UTF-8> tags, the W3C Markup Validation Service detects the following errors:

CODE

Character Encoding mismatch!
The character encoding specified in the HTTP header (iso-8859-1) is different from the value in the <meta> element (utf-8). I will use the value from the HTTP header (iso-8859-1) for this validation.
Warning Using windows-1252 instead of the declared encoding iso-8859-1.
Warning Legacy encoding windows-1252 used. Documents should use UTF-8.
Error Line 4, Column 20: Internal encoding declaration utf-8 disagrees with the actual encoding of the document (windows-1252). 

I don't understand where the iso-8859-1 and windows-1252 references come from. Any suggestions welcome.

Peter D

RE: HTML5 character encoding problem

HTTP Headers are not inside the HTML file, but headers of the HTTP protocol. You would need to look into the web server.
If you use PHP, send a http header with header('Content-Type:text/html; charset=UTF-8');

More tips, see http://htmlpurifier.org/docs/enduser-utf8.html

Bye, Olaf.

RE: HTML5 character encoding problem

(OP)
Hello Olaf,

Thank you; fixed this by 'AddDefaultCharset utf-8' in my .htaccess

Peter D.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close