Posts: 124
Joined: May 2009
Reputation:
1
2012-02-23, 21:30
(This post was last modified: 2012-02-23, 21:49 by VictorV.)
Try to convert it to a bytestring
s = u'Sigur R\xc3\xb3s'.encode('utf-8')
Posts: 3,547
Joined: Sep 2009
Reputation:
106
Unfortunately that doesn't work...same result.
Any other ideas - I think the info IS unicode utf-8, but I think maybe XBMC isn't interpreting it as such
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a
*full debug log*.
Posts: 3,547
Joined: Sep 2009
Reputation:
106
Hmmm ok passing it just artist = 'Sigur R\xc3\xb3s' WITHOUT making it a uncide string works!
That's odd...must be a double translation thing I guess?
Now, how to get the unciode strings into basic string in python - i.e. cast them I guess. I find this area a bit confusing....
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a
*full debug log*.
Posts: 3,547
Joined: Sep 2009
Reputation:
106
The problem is I am using a downstream library and is returning strings with these characters in them, so 'Sigur R\xc3\xb3s' - and these are type as unicode.
If I then pass them as this type, they come out in xbmc wonky. I need to just cast them or get the literal value of the string...but I can't seem to just get the literal value from a unicode string in a variable...
I think I am missing something obvious but have been missing it for two days now and it's driving me nuts!
Any python experts know how to do this??
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a
*full debug log*.
Posts: 3,547
Joined: Sep 2009
Reputation:
106
That looks like some amazing searching and indeed this issue...
However, you seem to have modified __quote instead of __unquote - is that right?
I tried it as __unquote (change the name and the call to __unquote) - I am currently stuck on _hextochr not being recognised....
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a
*full debug log*.
Posts: 3,547
Joined: Sep 2009
Reputation:
106
Give that man a cigar...
Yep, that works, and has the by-product of changing some other funky-ness in my code to something much simpler & neater.
Many many thanks mate, you went above and beyond.
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a
*full debug log*.