Displaying unicode symbols in HTML
You should ensure the HTTP server headers are correct.
In particular, the header:
Content-Type: text/html; charset=utf-8
should be present.
The meta tag is ignored by browsers if the HTTP header is present.
Also ensure that your file is actually encoded as UTF-8 before serving it, check/try the following:
- Ensure your editor save it as UTF-8.
- Ensure your FTP or any file transfer program does not mess with the file.
- Try with HTML encoded entities, like
uuu;
. - To be really sure, hexdump the file and look as the character, for the ✔, it should be E2 9C 94 .
Note: If you use an unicode character for which your system can't find a glyph (no font with that character), your browser should display a question mark or some block like symbol. But if you see multiple roman characters like you do, this denotes an encoding problem.
how to display unicode in html without javascript?
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;">🚘</span>
Special character not displaying as expected
1 - Replace your
<meta charset="utf-8">
with
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
2 - Check if your HTML Editor's encoding is in UTF8. Usually this option is found on the tabs on the top of the program, like in Notepad++.
3 - Check if your browser is compatible with your font, if you're somehow importing a font. Or try and add a css to set your fonts to a default/generally accepted one like
body
{
font-family: "Times New Roman", Times, serif;
}
Hope it helps :)
How to specify emoji version of a Unicode character in HTML?
I think you just specify the "emoji version" as a second entity. Like this:
<p>
✔<br/>
✔️<br/>
</p>
Related Topics
Allow 2 Decimal Places in ≪Input Type="Number"≫
Unwanted Margin in Inline-Block List Items
Ordered List (Html) Lower-Alpha With Right Parentheses
How to *Really* Justify a Horizontal Menu in Html+Css
How to Draw a Trapezium/Trapezoid with CSS3
What Is It When a Link Has a Pound "#" Sign in It
Prevent Scroll-Bar from Adding-Up to the Width of Page on Chrome
Preventing Firefox from Remembering the Input Value on Refresh with a Meta Tag
What Is the Best Practice for Creating a Favicon on a Web Site
Where Is the HTML5 Document Type Definition
Switching the Order of Block Elements With Css
Using "Margin: 0 Auto;" in Internet Explorer 8
Make an Image Responsive - the Simplest Way
Ng-App Vs. Data-Ng-App, What Is the Difference
Scale Image to Fit a Bounding Box
How to Center an Element in the Middle of the Browser Window
How to Make a Whole 'Div' Clickable in HTML and CSS Without JavaScript