Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to display unicode in html without javascript?

How do you display unicode character U+1F698, in the Transport And Map Symbols Block, in an html page preferably without using Javascript? I have found the following html scape secuence: 🚘 which, when included in an html page, shows the following square symbol 🚘, tested in chrome and firefox.

like image 683
oabarca Avatar asked Oct 08 '13 02:10

oabarca


2 Answers

The codepoints website appears to have a solution. They use the Symbola font which is added to the page using @font-face, and that renders some unicode symbols correctly, including the one specified in your question.

@font-face include (for testing, don't actually link to codepoints stylesheet when in production, instead copy it locally and link there instead):

<link rel="stylesheet" href="http://codepoints.net/api/font-face/Symbola.css">

Displaying the character:

<span style="font-family: Symbola, serif;">&#x1F698;</span>
like image 144
jvperrin Avatar answered Nov 10 '22 00:11

jvperrin


You probably do not have a suitable font that can display this symbol, or the font you have set it to cannot display it.

You could check if you have a font that has that character on this page.

According to this page, the only major font that supports this character is Symbola. (LastResort is not a real font)

like image 40
tckmn Avatar answered Nov 09 '22 23:11

tckmn