Reputation: 1666
Is there a way to put a ▐ (ascii value of 222
) in html character codes? (e.g. Þ
)?
Is this possible? If not, is there some way to make sure it is reliably rendered by a browser?
Upvotes: 1
Views: 129
Reputation: 128791
Using the official W3 Character Reference sheet, we can find what you're looking for. You have several options:
█
█
█
▮
▮
▮
❘
❘
❘
You can then take this a step further by looking into various Unicode regions. This region has a few similar lines:
▌
▍
▎
▏
▐
Note that you'll have to perform browser tests yourself, as not all browsers will be able to render these symbols. Ensuring that your page is in an appropriate UTF format (i.e. UTF-8) will help greatly.
Upvotes: 3
Reputation: 11
I believe you have answered your own question. The other HTML entity for that character is Þ Depending on your doctype, any compliant browser should render the character correctly.
Upvotes: 1
Reputation: 545608
is there some way to make sure it is reliably rendered by a browser?
Yes: encode your document as UTF-8 (really – it’s the default on the web and the best choice nowadays) and include the character directly in the document.
Every modern text editor / IDE supports saving documents as UTF-8. To serve it to the browser, specify the encoding in the <head>
section:
<meta charset="utf-8">
(This is HTML5; older versions are slightly different) and specify it in the HTTP header when serving the document from a server. Most servers are already configured to do this correctly.
HTML escape sequences, while still useful in certain scenarios, are by no means the easiest way of using arbitrary characters in HTML code.
Also, as others have noted, there’s some confusion here: ASCII only goes up to 127, there’s no ASCII character 222. Furthermore, ASCII is severely outdated and used almost nowhere nowadays. Most of the time, when somebody says “ASCII” they mean something else, and unfortunately they always mean different things. This is another reason to use Unicode and UTF-8 throughout: it avoids confusion.
Upvotes: 1
Reputation: 6355
I don't know from where you got "ascii value of 222". ASCII only goes to 127.
The character appears (to me) to be a U+2590 RIGHT HALF BLOCK. In HTML you can use ▐
.
Upvotes: 1