Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In browsers such as Firefox, Chrome and 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 is it called "Encoding" instead of "Decoding"?

share|improve this question
add comment

1 Answer

up vote 4 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.

share|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
2  
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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