tags:

views:

66

answers:

3

I was looking a source code of a particular page of my project and noticed that FF transforms special characters such as "á" to á.

Which encodification is that? Thanks!!

A: 

HTML ASCII Character Encoding. Here's a table of many of them:

HTML Codes

Justin Niessner
Questionable to call it ASCII; Unicode code point 225 isn't included in ASCII.
Simon Nickerson
Doh...bad wording. Editting.
Justin Niessner
+2  A: 

It's Numeric character references as defined in the HTML 4.01 Specification.

ax
Numeric character references are a form of entity defined in the spec you referenced.
free-dom
entities have a name, so a character entity reference must have a name (amp, lt, gt, apos, ...), too. Numeric character references don't have a name. http://en.wikipedia.org/wiki/Character_entity_reference
ax
+3  A: 

I suspect it is the other way round; Firefox and Chrome take á in the HTML source code and render it as the character á ("Latin small a with acute").

The reason for allowing these in HTML is that the HTML might be supplied in an encoding which doesn't support the character. Any Unicode character is allowed, but it may not get rendered correctly if your browser doesn't have that character in any of its fonts.

As it says in the W3C HTML spec, there are two ways of encoding arbitrary Unicode characters:

  • &#D;: where D is the decimal value of the Unicode character (e.g. á)
  • &#xH;: where H is the (case-insensitive) hexadecimal value of the Unicode character, e.g. 1 in your case
Simon Nickerson
Thanks!! I have many answers!
AndreMiranda