A collection of utilities for text escaping and unescaping in JavaScript. Try typing "abc" in the first form to see how it works. Any form can be edited.
Plain text | hide all |
---|---|
\uXXXX | hide |
---|---|
\UXXXXXXXX | hide |
---|---|
&#DDDD; | hide |
---|---|
&#xXXXX; | hide |
---|---|
Punycode | hide |
---|---|
\xXX | hide |
---|---|
\OOO | hide |
---|---|
Base64 | hide |
---|---|
Quoted-printable | hide |
---|---|
URL | hide |
---|---|
MIME + Base64 | hide |
---|---|
MIME + Quoted-printable | hide |
---|---|
Notes
- No data is sent to the server (i.e. everything is done in JavaScript).
- Conversion from Unicode to other encodings such as Shift_JIS can be slow first time as it needs to initialize internal conversion tables.
- Surrogate pairs in UTF-16 are supported. Try inserting
\uD840\uDC0B
in the second form. - Three-byte characters in EUC-JP are not supported.
Links
- JavaScript Unicode Charts
- Try GNU Libidn
- RFC 1468 Japanese Character Encoding for Internet Messages
- RFC 2396 Uniform Resource Identifiers (URI): Generic Syntax
- RFC 2047 - MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text
- RFC 3490 - Internationalizing Domain Names in Applications (IDNA)
- RFC 3491 - Nameprep: A Stringprep Profile for Internationalized Domain Names (IDN)
- RFC 3492 - Punycode: A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)
- Internationalized domain name - Wikipedia
TODO
- Japanese version of this page
- Support more encodings like GBK
- On-deman loading of conversion tables
- IDNA support (would be hard)