Unicode Store in JSON

Monte Goulding monte at appisle.net
Sun Oct 14 23:40:16 EDT 2018



> On 15 Oct 2018, at 2:31 pm, Sannyasin Brahmanathaswami via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> First can you clarify if both of these should work.? We see both in
> dictionary...
> 
> *Example*
> 
> textEncode("A","UTF16")
> 
> *put*textEncode(field"output","UTF-8") intotOutput
> 
> will the 2nd param work with or without a hyphen?

Yes
> 
> -----------
> unclarity --simply:
> 
> *Syntax*
> 
> textEncode(*stringToEncode*, encoding)
> 
> *Summary*
> 
> Converts from text to binary data.
> 
> ========
> 
> doesn't stipulate an "exception" for
> 
> "different libraries that treat JSON text encoding differently. mergJSON [snip] “

Well mergJSON is documented to return UTF-8 encoded JSON, however, I agree that JSONImport and JSONExport docs are a little ambiguous and should clarify that the JSON needs to be textDecoded before calling JSONImport and textEncoded after calling JSONExport.

Cheers

Monte





More information about the use-livecode mailing list