Quantcast

accents, graves & other funny charecters...

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

accents, graves & other funny charecters...

prothero--- via use-livecode
I always struggle with , or I should say with how liveCode and unicode interact and how many times it changes about hoow to use it as 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' ?


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 boo into fld 1

end mouseUp


dixie

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: accents, graves & other funny charecters...

prothero--- via use-livecode
Replacing the characters is too late, although it may be possible if you figure out every accented character’s alternate non-unicode variation.

See this article for how to fix the text before you use it:

http://lessons.livecode.com/m/4071/l/6930-how-do-i-use-utf-8-text-with-fields <http://lessons.livecode.com/m/4071/l/6930-how-do-i-use-utf-8-text-with-fields>

You will find though that other things fail to work with unicode. Also, the conversion that article suggests is giving back É instead of é.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: accents, graves & other funny charecters...

prothero--- via use-livecode
In reply to this post by prothero--- via use-livecode

I´ve entered the following text

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

into Ultraedit and set the encoding to UTF-8 i get this here

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

, which is the correct spelling then.

It seems your text is in MacRoman and needs to be converter to UTF-8 to get it displayed correctly.

But don´t ask me how.., i´ve always problems when it comes to encoding. ;)




Matthias Rebbe
Bramkampsieke 13
32312 Lübbecke
Tel +49 5741 310000
    +49 160 5504462
Fax: +49 5741 310002
eMail: [hidden email] <mailto:[hidden email]>

BR5 Konverter - BR5 -> MP3 <http://matthiasrebbe.eu/portfolio/produkte/brx/>

> Am 15.04.2017 um 18:52 schrieb John Dixon via use-livecode <[hidden email] <mailto:[hidden email]>>:
>
> I always struggle with , or I should say with how liveCode and unicode interact and how many times it changes about hoow to use it as 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' ?
>
>
> on mouseUp
>
> put "http://maps.googleapis.com/maps/api/geocode/json?latlng=<coord>&sensor=true <http://maps.googleapis.com/maps/api/geocode/json?latlng=%3Ccoord%3E&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 boo into fld 1
>
> end mouseUp
>
>
> dixie
>
> _______________________________________________
> use-livecode mailing list
> [hidden email] <mailto:[hidden email]>
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: accents, graves & other funny charecters...

prothero--- via use-livecode
Hi all,

we solved it by replacing the last line with:
  ...
  ## put boo into fld 1
  put textdecode(theAddress,"utf-8") into fld 1
end mouseup

:-)

> Am 15.04.2017 um 19:23 schrieb Matthias Rebbe via use-livecode <[hidden email]>:
>
> I´ve entered the following text
>
> Route Forestière de la Réserve, 50680 Cerisy-la-Forêt, France
> into Ultraedit and set the encoding to UTF-8 i get this here
> Route Forestière de la Réserve, 50680 Cerisy-la-Forêt, France
> , which is the correct spelling then.
> It seems your text is in MacRoman and needs to be converter to UTF-8 to get it displayed correctly.
> But don´t ask me how.., i´ve always problems when it comes to encoding. ;)
>
> Matthias Rebbe
>> Am 15.04.2017 um 18:52 schrieb John Dixon via use-livecode <[hidden email] <mailto:[hidden email]>>:
>> ...
>> on mouseUp
>> put "http://maps.googleapis.com/maps/api/geocode/json?latlng=<coord>&sensor=true <http://maps.googleapis.com/maps/api/geocode/json?latlng=%3Ccoord%3E&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 boo into fld 1
>> end mouseUp

Best

Klaus

--
Klaus Major
http://www.major-k.de
[hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: accents, graves & other funny charecters...

prothero--- via use-livecode
In reply to this post by prothero--- via use-livecode
Hi Colin & Matthias...


Klaus solved it with this oneliner...

put textdecode(theAddress,"utf-8") into fld 1

which works for me with the addresses that are being thrown back at me from google...


Dixie



________________________________
From: use-livecode <[hidden email]> on behalf of Matthias Rebbe via use-livecode <[hidden email]>
Sent: 15 April 2017 18:23
To: How to use LiveCode
Cc: Matthias Rebbe
Subject: Re: accents, graves & other funny charecters...


I´ve entered the following text

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

into Ultraedit and set the encoding to UTF-8 i get this here

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

, which is the correct spelling then.

It seems your text is in MacRoman and needs to be converter to UTF-8 to get it displayed correctly.

But don´t ask me how.., i´ve always problems when it comes to encoding. ;)




Matthias Rebbe
Bramkampsieke 13
32312 Lübbecke
Tel     +49 5741 310000
         +49 160 5504462
Fax: +49 5741 310002
eMail: [hidden email] <mailto:[hidden email]>

BR5 Konverter - BR5 -> MP3 <http://matthiasrebbe.eu/portfolio/produkte/brx/>

> Am 15.04.2017 um 18:52 schrieb John Dixon via use-livecode <[hidden email] <mailto:[hidden email]>>:
>
> I always struggle with , or I should say with how liveCode and unicode interact and how many times it changes about hoow to use it as 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' ?
>
>
> on mouseUp
>
> put "http://maps.googleapis.com/maps/api/geocode/json?latlng=<coord>&sensor=true <http://maps.googleapis.com/maps/api/geocode/json?latlng=%3Ccoord%3E&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 boo into fld 1
>
> end mouseUp
>
>
> dixie
>
> _______________________________________________
> use-livecode mailing list
> [hidden email] <mailto:[hidden email]>
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Loading...