Naming confusion : Why it is not called Decoding but Encoding in every browser?

0

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"?

Kit Ho

Posted 2011-09-04T10:00:21.980

Reputation: 3 467

Answers

4

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.

Mokubai

Posted 2011-09-04T10:00:21.980

Reputation: 64 434

But for the browsers, they are actually doing Decoding of my HTML document, aren't they? – Kit Ho – 2011-09-04T10:08:46.997

2Yes, 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 – 2011-09-04T10:12:30.263

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 – 2011-09-04T12:33:05.623