[Pas2js] store escaped strings

warleyalex warleyalex at yahoo.com.br
Tue May 15 15:27:53 CEST 2018


var
  compressed_UTF16: String;
begin
  compressed_UTF16 := '\u46C0\u4138\u19A0\u342A\u6056\u1020';

the compiler will emit:
  $mod.compressed_UTF16 = "\\u46C0\\u4138\\u19A0\\u342A\\u6056\\u1020"


AFAIK, we can store escaped strings. All string variables are escaped by
default. The only way would be to store at the localStorage. 
Any idea?

compressToUTF16("€13,56"); // --> 䛀䄸ᦠ㐪恖ဠ --->
"\u46C0\u4138\u19A0\u342A\u6056\u1020"
decompressFromUTF16("\u46C0\u4138\u19A0\u342A\u6056\u1020"); // --> "€13,56"
decompressFromUTF16( compressed_UTF16  ); // --> null

any idea?



--
Sent from: http://pas2js.38893.n8.nabble.com/


More information about the Pas2js mailing list