Question

Quelle est l'entité de caractères HTML pour le signe #? Je l'ai regardé autour de « livre » (la monnaie revient toujours), et « hachage » et « nombre », mais ce que j'essaie ne semble pas tourner dans le bon caractère.

Était-ce utile?

La solution

Vous pouvez rechercher sur le caractère individuel fileformat.info . Entrez # en tant que chaîne de recherche et le 1er coup vous mènera à U + 0023 . Faites défiler un peu vers le bas à la 2ème table, codages , vous verrez sous chaque les entrées suivantes:

HTML Entity (decimal)  #
HTML Entity (hex)      #

Autres conseils

The "#" -- like most Unicode characters -- has no particular name assigned to it in the W3 list of "Character entity references" http://www.w3.org/TR/html4/sgml/entities.html . So in HTML it is either represented by itself as "#" or a numeric character entity "#" or "#" (without quotes), as described in "HTML Document Representation" http://www.w3.org/TR/html4/charset.html .

Alas, all three of these are useless for escaping it in a URL. To transmit a "#" character to the web server in a URL, you want to use "URL encoding" aka "percent encoding" as described in RFC 3986, and replace each "#" with a "%23" (without quotes).

For # we have #.

Bear in mind, though, it is a new entity (IE9 can't recognize it, for instance). For wide support, you'll have to resort, as said by others, the numerical references # and, in hex, &#x23.

If you need to find out others, there are some very useful tools around.

# or #

http://www.asciitable.com/ has information. Wikipedia also has pages for most unicode characters.

http://en.wikipedia.org/wiki/Number_sign

There is no HTML character entity for the # character, as the character has no special meaning in HTML.

You have to use a character code entity like # if you wish to HTML encode it for some reason.

The numerical reference is #.

# is the best option because it is the only one that doesn't include the # (hash) in it. Supported by old browsers or not, it is the best practice going forward.

(What is the point of encoding something using the same symbol you are encoding?)

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top