In every browsers, Firefox, Chrome, IE, there is an option called Encoding. It is used to decode the HTML documents into different languages.

as far as i know, say, if i choose, "Encoding (Unicode UTF-8)" in my browser, the browser will treat the HTML page to be decoded in UTF-8 format.

My question is why it is not "Decoding" but "Encoding"? It is straight, isnt' it?

link|improve this question

69% accept rate
feedback

1 Answer

up vote 2 down vote accepted

It's called encoding based on the idea that the the file you are downloading is encoded in a particular format, in your case Unicode UTF-8.

When a file is encoded in this format we say that its encoding is Unicode UTF-8. It requires a UTF-8 decoder, but it is the encoding of the file itself which the program is talking about.

link|improve this answer
But for the browsers, they are actually doing Decoding of my HTML document, aren't they? – Kit Ho Sep 4 '11 at 10:08
1  
Yes, but you are telling the browser about the actual encoding of the file. Granted you could look at it the other way and say that it should use a particular decoder, but what if you have multiple weirdly named decoders for UTF that are all subtly different? Surely telling it about the actual file encoding and letting it decide what decoder to use makes a little more sense? – Mokubai Sep 4 '11 at 10:12
Got what you mean, thanks a lot – Kit Ho Sep 4 '11 at 10:13
Each document has a property called its Encoding and this option allows you to override that property. Some operations such as saving a page to disk may just write the name of the encoding and not actually decode anything. – mark4o Sep 4 '11 at 12:33
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.