accents graves and funny charecters....

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

accents graves and funny charecters....

Post by Dixie » Sat Apr 15, 2017 6:01 pm

I always struggle with , or I should say with how liveCode and unicode interact and how many times it changes about how to use it has always left me confused...Now, in fld "coord", I have ... 49.196839,-0.907385
I throw this at google and it returns the address...

Route Forestière de la Réserve, 50680 Cerisy-la-Forêt, France,

Can someone please show me, tell me... even shout at me ... what do I need to do to sort out these 'funny charecters' ?

Code: Select all

on mouseUp
put "http://maps.googleapis.com/maps/api/geocode/json?latlng=<coord>&sensor=true" into theURL
replace "<coord>" with fld "coord" in theURL
put URL theURL into temp

put lineOffset("formatted_address",temp) into red
set itemdel to ":"
put item 2 of line red of temp into theAddress
replace quote with empty in theAddress
delete char 1 of theAddress
put theAddress into fld 1
end mouseUp
dixie

Klaus
Posts: 13823
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: accents graves and funny charecters....

Post by Klaus » Sat Apr 15, 2017 6:12 pm

Hi Dixie,

this one produces nice output, that looks really french:

Code: Select all

   ...
   ## put theAddress into fld 1
   put textdecode(theAddress,"utf-8") into fld 1
end mouseup
:D


Best

Klaus

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: accents graves and funny charecters....

Post by Dixie » Sat Apr 15, 2017 6:17 pm

Klaus..

Thanks... :-)

Dixie

Post Reply

Return to “Talking LiveCode”