-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-ascii chars in Shoutcast Protocol #71
Comments
Alright, I changed every instance of encode('ascii') to encode('utf_8'), and GMusicProxy is no longer spitting errors on Tiësto songs. The patch is attached. NOTE: I did NOT change the decode('ascii') methods, as they weren't spitting errors... But I don't know what consequences may arise from doing so. |
Alright, I ended up having more problems with this, so I ended up ALSO changing the .decode('ascii') methods to .decode('utf_8'), and I changed the char encoding to unichar. The attached patch supercedes the previous one, making all of the required changes to convert from ASCII encoding to UTF-8 encoding, and should now support weird chars. |
I think this patch may have introduced a new bug... Let's see if it's reproducable for anyone else before I start jumping to conclusions. I am running the latest 1.0.7 beta 1. Now all the songs will play and display shoutcast metadata, even with special characters. However, in both Amarok and VLC, those songs that have special characters will play at a highly accelerated rate (Maybe 2X speed?). I did most of my initial testing with the volume down, so I didn't notice :p Anyway, two examples I have are Secrets by Tiësto, http://localhost:9999/get_song?id=Tolnlbjpoxmhg7hermh5kkfud7i |
I can confirm this VERY strange bug: it could be related to the shoutcast metadata implementation (not mine) and the characters could be the trigger condition that raise (in this very strange way) the bug. The same songs play well without the shoutcast metadata. I'm reopening this report as reminder, but I have not time for this now. |
While I was testing tags support, specifically with Shoutcast support enabled, I noticed some errors in my logs pertaining to "Secrets" by Dutch DJ Tiësto, to the effect that the "ë" was out-of-range for ASCII encoding.
The song ID in question is http://localhost:9999/get_song?id=Tolnlbjpoxmhg7hermh5kkfud7i
And the specific error was "UnicodeEncodeError: 'ascii' codec can't encode character u'\xeb' in position 2: ordinal not in range(128)"
I SUSPECT that changing all of the "encode" and "decode" methods to use some superset of ASCII, but I haven't tested anything yet.
The text was updated successfully, but these errors were encountered: