Page 1 of 1

accents graves and funny charecters....

Posted: Sat Apr 15, 2017 6:01 pm
by Dixie
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

Re: accents graves and funny charecters....

Posted: Sat Apr 15, 2017 6:12 pm
by Klaus
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

Re: accents graves and funny charecters....

Posted: Sat Apr 15, 2017 6:17 pm
by Dixie
Klaus..

Thanks... :-)

Dixie