Click to See Complete Forum and Search --> : setting character encoding in HTML


CaptainPinko
08-01-2004, 11:11 PM
I was trying to validate some HTML I was writing by hand with http://validator.w3c.org by uploading the file from my hard drive. But I keep getting this message:


No Character Encoding Found! Falling back to UTF-8.
...SNIP...
The uploaded file was tentatively found to be Valid. That means it would validate as HTML 4.0 Transitional if you updated the source document to match the options used (typically this message indicates that you used either the Document Type override or the Character Encoding override).


and no matter what I try I can't seem to get it validated and searches have not turned out too helpful. My html header looks like

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">

<html>

<head>
<title>The Title!</title>
<META HTTP-EQUIV="HTML" CONTENT="text/html; charset=iso-8859-1">
</head>


The page will be in Polish which uses non-english characters (but it still latin based; it is not Cyrillic) so it seems that either UTF-8 or iso-8859-1 should be good candidates.

JohnT
08-02-2004, 04:56 AM
http://nl.ijs.si/gnusl/cee/iso8859-2.html

CaptainPinko
08-02-2004, 02:24 PM
Thanks for replying but I got a more specific answer on another forum already. For anyone interested and for anyone searching for help here it is:

You just need to modify the meta tag. It should read "Content-Type":


code:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

bwkaz
08-02-2004, 06:25 PM
Or just upload the page to your web server and have the web server send the Content-Type: header appropriately...

The way you have it now (with the meta tag), the validator will complain (maybe only a warning) once you actually do upload it to a web server. Especially if the web server is sending a Content-Type of "text/html; charset=utf8" (or iso8859-1), and you're overriding it with a charset of something else...