Can I use ANSI charset in HTML files?

Asked

Viewed 1,544 times

3

In order to be able to publish texts daily using some editor like Notepad++ for example, I would like to type the words with an accent and save them in the HTML file. I’ve been reading that the UTF-8 a code for the accents is required. For example the is corresponds to é.

I wonder if I can use charset ANSI in HTML files so you don’t have to be typing the codes UTF-8 for each special character or accent.

1 answer

2


You are confused, UTF-8 has nothing to do with "HTML entities" like é. UTF-8 is a way to represent the characters in bytes, as well as ANSI (Windows-1252, similar to ISO-8859-1, or Latin 1). The difference is that ANSI characters always use 1 byte each, while in UTF-8 uses 1 to 4 bytes. Therefore, with UTF-8 it is possible to represent a much larger amount of special characters.

Nowadays, it is highly recommended to use UTF-8 instead of ANSI or other more limited encoding. If files are saved as UTF-8 and HTML is being delivered by the server with the correct HTTP headers, everything will work smoothly.

  • You are saying that I can type normally with accents as long as my charset is as UTF-8 and the file save as UTF-8. Okay all right. And when should I use é ?? for what exists this type of encoding?

  • This, can type normally :) You rarely need to use á and similar, unless you want to prevent user-generated HTML code from being interpreted.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.