unicode to JSON-String/javascript-string converter

 

Overview

this converts UNICODE text to Javascript strings or JSON strings (same).

unicode to JSON-String/javascript-string converter

type here to convert any unicode string to a JSON string (conversion is automatic):

""


I wrote this as an answer to a yahoo answers question in programming the text I was going to replace it with before I got blocked from editing (since I found some things in the code which needed to change) was:

you are going to have to write your own unicode to JSONStringCharacter converter. the BNF Grammar for the language is here.

I am sure you can use javascript to do it and a simple UTF-8 DHTML form.

a UnicodeEscapeSequence basically looks like

\uFFFF
other allowed escape sequences are:
\"
\/
\\
\b
\f
\n
\r
\t

and you can have any ascii character except " and \ by themselves in the string. the string must be surrounded by double quotes "like this".

you can use my web page (2nd link).

http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf
http://Jesusnjim.com/web-design/unicode-to-javascript-string-json-string-converter.html