background preloader

Utf

Facebook Twitter

JavaScript and Unicode. ASCII only allows for 128 different characters and 32 of those are allocated to control characters leaving only 96 actual displayable characters that can be used. Manyof the world's languages use characters that do not fit within this small group. There are also a lot of special symbols used in specialized areas such as mathematics.

To cater for this much larger range of characters in a standard way, the Unicode character set was developed. This matches the ASCII characters for the first 128 but provides a way of specifically identifying over 16 million different characters. Unicode characters are specified in JavaScript by typing a backslash, a lowercase "u", and then the four digit hexadecimal number corresponding to the character's encoding in the utf-16 character set. Is the Unicode Character : " ". One thing that you do need to watch for if you start using unicode characters in your web page is that there are a few javaScript functions that do not handle unicode. About.com: Interactive Text-to-Binary Decoder. Interactive ASCII/Unicode to Binary/Decimal/Hex Decoder An interactive, "ajax-style" mini-application, supporting conversion to binary/decimal/hex as you type, copy/paste of ASCII and Unicode characters.

If you type/copy/paste non-ASCII characters like 您好 you will see their unicode representation -- note that non-ASCII characters are represented in more than 8 bits, so you may need to increase the pad amount to fit the longest character. H=01001000e=01100101l=01101100l=01101100o=01101111↵=00001010您=110000010101000好=101100101111101↵=00001010よ=11000010001000う=11000001000110こ=11000001010011そ=11000001011101↵=00001010V=01010110ä=11100100l=01101100k=01101011o=01101111m=01101101m=01101101e=01100101n=01101110.