I'm reading the W3Schools' HTML Tutorial, in particular the HTML URL Encoding section.
Here it says that:
URLs can only be sent over the Internet using the ASCII character-set. If a URL contains characters outside the ASCII set, the URL has to be converted.
And:
Your browser will encode input, according to the character-set used in your page.
For example (about this last point) the character €
is encoded in %80
for Windows-1252 and %E2%82%AC
for UTF-8.
My question is: if there can be used only ASCII characters, why are there two ways of converting the same character depending on the charset used? Couldn't there be just one? What's the gain in this way? Following this, why should I use the accept-charset
attribute?