I don't understand HTML

So, I encoded my HTML file as UTF-8, and specified in the HTML file that it was UTF-8. Apparently my college's webserver explains that it is not UTF-8 and is instead iso-8859-1. Not only that, but apparently despite being encoded in UTF-8 the file is still in windows-1252.

At this point I have absolutely no idea what in the world I am doing. I guess at the end of the day, at least a browser can actually display the page.
This is a pretty random suggestion I pulled from a page I made a long time ago, but try:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
instead of the meta charset you have.

Edit 1: Oh, also, the error seems to suggest that the document itself isn't encoded in utf-8; did you make sure the text editor you were using was saving as UTF-8 and not ISO-8859-1?

Edit 2: It seems the Content-Type header specifies the charset in the HTML headers, which if unspecified defaults to ISO-8859-1. My guess is that that bit is unspecified so the default response is assumed, which contradicts what you specify as the charset in your meta tag.
Last edited on
I'm using HTML5, which is why the meta tag is simpler. I did save in UTF-8 with the text editor but it doesn't change the binary representation of the file at all since I'm not using any strange symbols. Unfortunately I don't think I can change the information the university server sends in the header - oh well.
I don't understand why it is giving that error and those warnings especially for such a simple page. I learned HTML in a couple of weeks my freshman year of high school, and then took a web publishing class senior year. Turned out I knew more than the teacher teaching is always sad (to add to the matter he was the school's webmaster). Not really seeing any reason for it to give those errors, but it has been a while since I did an HTML page.

It was so bad I got an A for this crap:
Cartooning and Animation: http://tinyurl.com/otnlhz8
Web Publishing: http://prntscr.com/2lvmg6
Last edited on
I suppose it is possible for your server to be sending a Content-Type header that is different than the one on your page. IIRC the one in the header is the one that is preferred, so that could be why you are getting errors.

Even though it is UTF-8, perhaps you could try to insert a BOM and see if that has any effect.
closed account (Dy7SLyTq)
i think even if you dont use strange-symbols utf-8 still isnt compatible with iso values. but i could be wrong
@ZHuge: I tried BOM before and the validator spat a handful of errors just for the BOM being there.
There is 2 fixes to this problem:
1 - use windows-1252 encoding in your META tag if you don't have access to PHP or any programming language in the webserver:
<meta charset="windows-1252" />

2 - change Content_type header of your webserver to utf-8:
PHP example:
header ("Content-Type: text/html; charset=utf-8");

Test page working (it is hosted on my computer, so may be offline):
I think there is nothing I can do to change what the webserver sends, it doesn't want to run PHP scripts. I was just wondering why it gets detected as windows encoding instead of UTF-8 or iso.
Topic archived. No new replies allowed.