Unicode Store in JSON

J. Landman Gay jacque at hyperactivesw.com
Sun Oct 14 20:43:43 CEST 2018


I'd store the text normally, without alteration, in the JSON. TextEncode 
it when you send it to the database and textDecode when you retrieve it 
from the database.

On 10/14/18 9:26 AM, Sannyasin Brahmanathaswami via use-livecode wrote:
> I need to store unicode in JSON on Mobile; and store that in SQLLite dBase
> 
> If you do a "direct" transfer
> 
> *put*(char1to35oftQuote)& "..."intosTruncFirstLine
> 
>          "Yea, jīva is actually Śiva."
> 
> # putting sTruncFirstLine into an SQLLite column
> # when you get the data out, it becomes
> 
>          "Yea, jƒ´va is actually ≈öiva...."
> 
> "textEncode" won't work because it produces binary code, can't store in
> JSON...
> 
> base64 should work, but I get similar results,
> 
> *        put*(char1to35oftQuote)& "..."intosTruncFirstLine
> 
> *        put*base64Encode(sTruncFirstLine) intosTruncFirstLine
> 
>                    # restore later
> 
> *        put*base64Decode(pEntryA["label"]) intotLab*el**
> *
> 
> *        set*thetextoffieldtName totLabel
> 
>                  # returns "garble"
> 
> What are my other options?

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list