Re: Translating escape sequence

2017-03-14 Thread J. Landman Gay via use-livecode
On 3/15/17 12:00 AM, Monte Goulding via use-livecode wrote: Try patching it like I have done here https://github.com/montegoulding/mergJSON/pull/8 Hey, I figured out how to patch and where they hid your libraries. It works! :) -- Jacqueline Landman Gay | jac...@hyperactivesw.co

Re: Translating escape sequence

2017-03-14 Thread J. Landman Gay via use-livecode
On 3/14/17 11:58 PM, Phil Davis via use-livecode wrote: Maybe right after you import the JSON data, preprocess it with something like this: set the lineDelimiter to "\u" repeat for each line tLine in tJsonData put numToCodePoint("0x" & char 1 to 4 of tLine) & char 5 to -1 of tLine after tNew

Re: Translating escape sequence

2017-03-14 Thread Monte Goulding via use-livecode
> On 15 Mar 2017, at 5:08 pm, J. Landman Gay via use-livecode > wrote: > > Cool. :) I'd patch it if I knew how to do that but I don't know enough about > git to even start. But since you've put in a pull request, I can wait until > the next dp. I meant you could patch it in your copy of LC.

Re: Translating escape sequence

2017-03-14 Thread J. Landman Gay via use-livecode
On 3/15/17 12:00 AM, Monte Goulding via use-livecode wrote: On 15 Mar 2017, at 3:28 pm, J. Landman Gay via use-livecode wrote: So I'm stuck, I don't see any way to deal with these. I'll put in a bug report about jsonImport() but it will probably be a while before it gets fixed. I hope someon

Re: Translating escape sequence

2017-03-14 Thread Monte Goulding via use-livecode
> On 15 Mar 2017, at 3:28 pm, J. Landman Gay via use-livecode > wrote: > > So I'm stuck, I don't see any way to deal with these. I'll put in a bug > report about jsonImport() but it will probably be a while before it gets > fixed. > > I hope someone else has an idea. I do -) Jansson (the l

Re: Translating escape sequence

2017-03-14 Thread Phil Davis via use-livecode
Maybe right after you import the JSON data, preprocess it with something like this: set the lineDelimiter to "\u" repeat for each line tLine in tJsonData put numToCodePoint("0x" & char 1 to 4 of tLine) & char 5 to -1 of tLine after tNewData end repeat put tNewData into tJsonData Then go o

Re: Translating escape sequence

2017-03-14 Thread J. Landman Gay via use-livecode
Thanks. I actually was using jsonImport() with these strings successfully (no wrapper required) but it has a bug on Android that makes it unuseable. That's what caused the problem in the first place, because jsonToArray() doesn't deal with escape sequences. So I went ahead and wrote a decoder

Re: Translating escape sequence

2017-03-14 Thread Jim Lambert via use-livecode
> Jacque wrote: > > I'm dealing with non-English languages, and JSON data retrieved from a > database comes in with unicode escape sequences like this: Eduardo > Ba\u00f1uls. > > I need to translate those. I can do it by replacing the "\u" with "0x" > and then using numToCodepoint() to get th