do something? Does it do anything or is it just there to let the programmer know tha...">

<Meta charset = "utf-8" / "> do something?

Does it <meta charset="utf-8" />

do anything or is it just there to let the programmer know that this particular encoding is being used?

In other words, if I completely removed that line, or forgot to write it down, would utf-8 still be an encoding?

+3


source to share


2 answers


Does anything or is it just to let the programmer know what exactly this encoding is being used?

It tells the browser which encoding to use to decode the page. The browser needs to use some encoding to include the byte stream in the text, and if you don't specify an encoding it will look with some encoding.

If I remove that line entirely, or forget to write it, will utf-8 still have to be encoding?



It depends on whether there is a byte order in the file in the file and what the server is sending in the HTTP header. If you omit the encoding from the page, the browser will look for a byte order mark, and if not, it will appear in the header. If no encoding is specified at all, it will look at the contents of the byte stream to guess what encoding it might be in.

There is an exact procedure outlined in the HTML standards for how the browser should try to detect the encoding. Although the steps are listed, exactly how each is performed depends on the browser. This means that different browsers can actually use different encodings if you don't specify them.

0


source


Yes, as it specifies the encoding to encode the document and allows the browser to display such. Different languages ​​have different encodings.

http://www.w3schools.com/tags/att_meta_charset.asp



http://www.w3schools.com/html/html_charset.asp

http://www.w3.org/TR/html-markup/meta.charset.html

+1


source







All Articles