Should all accented characters use html entities?

后端 未结 3 1630
慢半拍i
慢半拍i 2020-12-16 14:00

I am working with a large number of HTML files that are mostly encoded as utf-8. There are accented characters galore as many are in French. I have been converting them to H

3条回答
  •  时光取名叫无心
    2020-12-16 14:37

    There is normally no reason to use entities for characters like accented letters. Using them is valid but tends to obfuscate the source code and may therefore cause errors.

    However, in some cases the entities are needed. The reasons are not related to browsers but to the authoring side. In particular, if you need to edit the files using an editor or an authoring program that does not handle accented letters well, you may find entities useful. The same applies if the data has to pass through some software that has similar problems. And in some cases, you need to work within an environment where you have no control over HTTP headers and the headers specify an encoding that does not let you enter all characters directly.

提交回复
热议问题