Subj : Re: WX
To : Deuce
From : KenDB3
Date : Wed Apr 13 2016 02:15 pm
Re: Re: WX
By: Deuce to Digital Man on Wed Apr 13 2016 01:32 am
> >> I think my problem is that data is coming back from Weather
> >> Underground in UTF-8, which is not a problem when it is in (US)
> >> English, but starts to present a problem with the couple of Latin
> >> based languages I tried to implement. Is there any way to
> >> clean/convert the text before displaying it?
>> Yes, UTF-8 could be translated, but the results may not be very
>> good/useful, depending on stuff (e.g. the source and target locale).
> >> Someone asked for this feature, and I thought it would be an easier
> >> ask than some of the other requests I got, but it proved more
> >> challenging thanks to the UTF-8 characters.
> >> Any advice is welcome :-)
>> Stick to US-English? :-) Seriously though, I don't really have any
>> advice on this topic as I haven't been big on translating software to
>> other locales or worrying about non-CP437-capable terminals. Maybe
>> Deuce has some advice.
De> In the latest CVS, there's a utf8_cp437.js file you can load()... after
De> you do, you can call utf8_cp437(utf8_string) and it returns a cp437
De> version of the same string. It handles most common codepoints, but unknown
De> ones are replaced with a question mark. If you find ones that need to be
De> added, please let us know.
Thanks Deuce. You and DM rock. I'll see if I can utilize it and how it plays
along with the Weather Underground data coming back. If it's more trouble than
it is worth, I may take DM's rather realistic advise and stick to English, lol.