Page 2 of 2
Re: Getting JSON from Google Sheets with unicode chars
Posted: Mon Sep 30, 2019 9:01 pm
by kaveh1000
Re: Getting JSON from Google Sheets with unicode chars
Posted: Mon Sep 30, 2019 9:05 pm
by bn
Thanks Kaveh,
but this one also has only one column. Could you add a couple of columns?
Thanks
Bernd
Re: Getting JSON from Google Sheets with unicode chars
Posted: Mon Sep 30, 2019 9:07 pm
by kaveh1000
Re: Getting JSON from Google Sheets with unicode chars
Posted: Mon Sep 30, 2019 9:18 pm
by bn
Hi Kaveh,
https://docs.google.com/spreadsheets/d/ ... sp=sharing
when I open the url in a browser I see 4 columns but only one is retrieved via your retrieval routine. And that one column is the same as before. Could you test this in your copy of "putJasonIntoTable.livecode"?
Column 2 and 4 have a lot of backslashes and curly brackets. Probably not the best test cases for Jason.
Kind regards
Bernd
Re: Getting JSON from Google Sheets with unicode chars
Posted: Mon Sep 30, 2019 9:30 pm
by kaveh1000
did you put "four_rows" into the sheet name? I did and I think the columns are all coming in when I step through. However something seems to crash it out in the repeat look with
numToCodepoint.
I bet it is one of the colons.
I have set up another sheet now, sheet4:
https://docs.google.com/spreadsheets/d/ ... 1713871980
you can edit this one, so do whatever...
I get repeating columns of numbers and then I think the fourth column..
Re: Getting JSON from Google Sheets with unicode chars
Posted: Tue Oct 01, 2019 12:15 am
by bn
Hi Kaveh,
I found the problem. The first one was a bug I did not catch with only one column. I overwrote rows with row numbers instead of only applying them to the first item only.
The second problem was in "four_rows" where you had a "\u" as a literal and it broke my assumption that "\u" is always the begin of a unicode hex.
Solution: I replaced "\\u" with "backslashU" in tData and restore after resolving unicode hex stuff.
I added an option menu where you can choose the four sheets I see easily and they all work now. It is good that you put up the torture tests and I am glad that they work now.
Kind regards
Bernd
Re: Getting JSON from Google Sheets with unicode chars
Posted: Tue Oct 01, 2019 12:19 pm
by kaveh1000
Bernd, this is great. Thank you!
Re: Getting JSON from Google Sheets with unicode chars
Posted: Tue Oct 01, 2019 12:47 pm
by bn
Kaveh,
glad it helps. Is this helpful for your project?
This does not solve the problem of a cell containg more than one line. But I don't know of a way in livecode to put multiple lines into one cell of a table.
I had a look at the code again and there is one remnant line of an earlier attempt in handler "resolveArrayIntoTable"
put pDataArray["table"]["rows"][aRow]["c"] into tColumnNumber
which has no function in the current version. You could delete that line.
KInd regards
Bernd
Re: Getting JSON from Google Sheets with unicode chars
Posted: Tue Oct 01, 2019 2:12 pm
by kaveh1000
Hi Bernd
Yes, this is very helpful, as I have so many strange characters. So glad I had the "\u" in the set and so glad you spent time solving it!! I still have not had time to go thro in detail but it will be very useful for me to do that.
I don't actually need the data in a table in LiveCode. I think I can work out a way of dealing with returns in a cell.
thanks again.