Skip to content


Subversion checkout URL

You can clone with
Download ZIP


unicode --> latin-1 for weather wunderground alerts to fix special chars... #2495

wants to merge 1 commit into from

3 participants


... (ä,ö,ü etc)

is there a reason that this was never fixed? does it break something else when converting to latin-1? seems to work here without problems...

EDIT: I see, i get an "&NBSP" now at the end.

should i fix that with some string parsing?
or do you expect them to make the fixes on their API side?


ok, will close then. was just wondering since it is a default feature and totally looks unreadable in german for example.
thx for heads-up.

@phil65 phil65 closed this

the. unescaped html as well ronie?


yeah read that. i just thaught it would be nice to get it fixed on xbmc side since it´s broken for a long long time and i doubt that they´ll ever fix that.


@phil65 i don't see how that could be fixed xbmc side, but if you've got some ideas, i'm all ears :-)
i did try your patch, but it didn't make any difference at my end (tested on both linux & windows)

@cptspiff yup, the api provides a completely garbled alerts message.


hmm at least on my end it fixed the errors for ä,ö, and ü which are often used in German. (it introduced some "&NBSP" (--> space) at the end though, but if that´s all we could remove that manually in python of course)


this is what i get (with or without your patch):

looks pretty messed up to me, but again, if it's fixable at our end, i'm all for it.


strange, perhaps i was wrong. tested properly again and my patch doesn´t change anythin when using confluence.
in nox (displayed in a textbox control) the characters appear correctly...


heh figured it out why it works in one skin but not the other:
line 523 & 524 also need the fix.

this seems to work ok:

if you could give it a spin:


yep, workin here.
anything wrong with fixing it this way @cptspiff ?


yes. still wrong. ronie; you decode into the python encoding. you manipulate, then you encode in the encoding you want to return (utf8)


ehrr too early read it backwards. that is fine indeed. though you should still move the strip in principle.


k, will move the strip between the en- and decoding.

i've posted a test version on the forum so users can test this stuff
before i push it to the addon repo.

@phil65 phil65 deleted the phil65:wunderground-encoding branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 24, 2013
  1. @phil65-2
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 addons/weather.wunderground/
4 addons/weather.wunderground/
@@ -515,8 +515,8 @@ def properties(data,loc):
rss = ''
alerts = ''
for count, item in enumerate(data['alerts']):
- set_property('Alerts.%i.Description' % (count+1), item['description'])
- set_property('Alerts.%i.Message' % (count+1), item['message'])
+ set_property('Alerts.%i.Description' % (count+1), item['description'].encode('latin-1'))
+ set_property('Alerts.%i.Message' % (count+1), item['message'].encode('latin-1'))
set_property('Alerts.%i.StartDate' % (count+1), item['date'])
set_property('Alerts.%i.EndDate' % (count+1), item['expires'])
set_property('Alerts.%i.Significance' % (count+1), SEVERITY[item['significance']])
Something went wrong with that request. Please try again.