Strange Characters...

Mark Waddingham mark at livecode.com
Thu May 7 10:41:36 EDT 2015


On 2015-05-07 15:47, John Dixon wrote:
> Now that we have unicode that 'just works' ?!
> 
> CAn someone tell me what I am doing wrong, or even better what to do
> now as what used to work for me doesn't anymore...:-(  Using the lines
> below, I make a request to a datbase through an .lc script...The
> result is returned to temp..
> 
>    put
> "http://www.xxxxxxxx.com/spencerdata/index.lc?A=index&thetongue=" &
> thelanguage into tURL
>    put URL tURL into temp
> 
> If there are any accents and other strange characters then garbage is
> returned.... Can someone tell me what to do ?

I suspect the data you are getting passing to the client is encoded as 
UTF-8. In this case you should be able to set a 'Content-Type' HTTP 
header when sending back the data to 'text/plain; charset=utf-8' and in 
an ideal world libUrl would 'do the right thing'. However - having just 
looked at libUrl for 7.0.4; I'm not entirely convinced it *is* doing the 
right thing. I'll file a bug on that once I've double checked.

In the meantime, this should make things work:
    put textDecode(URL tURL, "utf8") into tURL

Warmest Regards,

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list