Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] Encoding Unicode characters in HTML


  • From: charles.albrecht at gmail.com (Charles Albrecht)
  • Subject: [Javascript] Encoding Unicode characters in HTML
  • Date: Mon Aug 22 00:19:52 2005

On 8/18/05, Judah Frangipane <judah-fc@xxxxxxxxxxxx> wrote:
> I know how a person can encode an ampersand in html. They use "&amp;"
> and this code is rendered by the browser into "&".
> 
> What I don't know is how to encode a unicode character. I am trying to
> encode a bullet character. The keystroke is ALT+0149 as displayed here
> ?. There are many more unicode characters that I would like to let my
> users use. How do I encode the characters so that the browser renders
> them correctly?

The bullet character is unicode code point 8226 (2022 in hex), not
0149. 149 is its "ASCII" value in some character encoding. Maybe ISO
8859-1, maybe UTF-8, but maybe not. If you use &#149; (anything over
127) you may need to make sure you specify a character encoding for
your page to be certain it displays correctly for browsers on all
platforms.

Use &bull; for a bullet. But &#x2022; and &#8226; are both usable.

See http://en.wikipedia.org/wiki/Unicode_and_HTML for more about
Unicode encodings for your html.

-Charles
 charles.albrecht@xxxxxxxxx