Retrieving text with accents

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
simon.schvartzman
Posts: 276
Joined: Tue Jul 29, 2014 12:52 am
Location: Brazil

Retrieving text with accents

Post by simon.schvartzman » Wed Jan 16, 2019 7:48 pm

Hi, I'm using Google Places API in my App and the JSON answer includes accents (I live in a portuguese speaking country), the problem I'm facing is that the response gets unformatted when "enters" the LC environment...

To better explain myself this is the response when the request is submitted from the browser:
browser.jpg
And this is when I submit using put URL in LC and show the result in a List Field.
lc.jpg
How should I deal with it in order to get the same result in LC?

Help would be appreciated.
Simon
________________________________________
To ";" or not to ";" that is the question

matthiasr
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 83
Joined: Sat Apr 08, 2006 7:55 am
Location: Lübbecke, Germany
Contact:

Re: Retrieving text with accents

Post by matthiasr » Wed Jan 16, 2019 8:01 pm

You could try to use textdecode() function to convert the complete response.

It tried just with only S√£o Paulo.

Put textdecode("S√£o Paulo","UTF-8") returns the correct spelling.

Matthias

simon.schvartzman
Posts: 276
Joined: Tue Jul 29, 2014 12:52 am
Location: Brazil

Re: Retrieving text with accents

Post by simon.schvartzman » Thu Jan 17, 2019 2:19 am

Matthias, thank you very much for your input, it worked fine.

Regards
Simon
________________________________________
To ";" or not to ";" that is the question

Post Reply

Return to “Talking LiveCode”