Charset problem (Was: Re: Weather reporting in Rev)
Mark Smith
lists at futilism.com
Thu Jun 18 14:37:34 EDT 2009
Dom, I use these two functions in my library to deal with utf8:
function utf8decode pString
return unidecode(uniencode(pString,"UTF8"))
end utf8decode
function utf8encode pString
return unidecode(uniencode(pString),"UTF8")
end utf8encode
They will convert to and from whatever you're local charset is.
Best,
Mark Smith
On 18 Jun 2009, at 15:09, Dom wrote:
> Ken Ray <kray at sonsothunder.com> wrote:
>
>> I'd probably use "screen scraping" techniques; for example, my zip
>> code is
>> 54701, so I go to weather.com and enter my zip. That takes me to a
>> page
>> which is this URL:
>>
>> http://www.weather.com/weather/local/54701?
>> lswe=54701&lwsa=WeatherLocalUndec
>> lared&from=searchbox_localwx
>
> Here in France, we have a subsidiary of weather.com named
> meteo123.com*
> :-)
>
> Anyway, your technique is working -- but, as the web is coded
> according
> to the UTF-8 charset, there are some woes with the accented characters
> ;->
>
> The "charset" property of a stack is read-only - and can only be
> "MacOS"
> or "ISO" (i.e. ISO 8859, Latin)
>
> Is it possible to work around this, not by hand?
> Will the UTF-8 charset be implemented in the future?
> something like "UTFTo mac" and "MacToUTF" ;-)
>
>
> * "http://m.meteo123.com/xhtml/cc/59270"
> I preferred to take the "Mobile" version, as the code is simpler to
> parse
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list