Closed jamontes closed 8 years ago
Hi !
First of all, thank you for all the work you put in your ticket !
Deep and clear analysis of the problem :)
I actually went through the exact same steps in order to "resolve" this in the commit 0c3daf302a23deedbe1edbf37fdb7eb421708cd4 (didn't come up with a better solution either ^^)
Were you using the version avialble on the official repo or the developement version from github ?
I recently made an update request to the Kodi addons mailing list and release v0.5.3 should be out in a few days !
Hi bmf,
I wasn't aware you already were working on the same problem. I should followed your repo commits history instead to try to fix by my own working over the downloaded KODI repo version on my local French system :-)
As i follow the KODI development list, i did know a new release was pending of summit to the official repo, but i followed the two latter commits on your repo to see the improvements (i.e. the "cosmetic" ones), and didn't go further to realize of the 0c3daf3 commit where you were facing the problem.
To be honest, i was facing the same problem as you some time ago with the add-ons i've developed, and went to the same solution (i.e. keep the located strings of the user notifications as pure ASCII), but didn't remember till now that i reviewed my own code (as i keep the localized strings from one add-on to the next almost the same, so the problem didn't pop up again). it's the old funny story of human nature (to commit the same mistakes more than once) i'm afraid ;-)
Thanks a lot for your quick answer, and thanks again for keep improving your nice add-on.
Best regards,
jamontes.
Hi bmf,
I've forgotten to tell you i've downloaded release V0.5.3 from your repo and it worked like a charm, so you can close this issue, even more that the new release is already available on the official Kodi repo for update.
Best regards,
jamontes.
Hi bmf,
Taking the chance of installing your wonderful add-on over a French KODI system, i've discovered a problem concerning the download feature on the plugin.notify calls using the UTF-8 (i.e. non ASCII) localized add-on strings.
The point is that the function download_file makes use of the plugin.notify function to let know the user through the GUI of the downloading progress and result. But whenever the strings passed to some of the plugin.notify calls contains a non ascii character (i.e. the accentuated "é" on the strings 30007 to 30010 of the french strings.xml file), an UnicodeEncodeError exception is raised, breaking the code.
This error is very reproducible at every time whenever you try to download a video and have configured the French language as your system language on KODI. I didn't realize of that before, because under normal conditions my system language at home is neither of the located languages supported by the add-on, so it defaults to English (i.e. no accents, just ASCII chars). Removing the accentuated characters at strings 30007, 30008 and 30010 from the French strings.xml file solves the problem and the video file downloads work really fine as usual.
Just bear in mind that this UTF-8 problem only happens on the plugin.notify calls used by the download_file function. The rest of the localized messages are handled by the add-on and KODI without any problem, and showed by the UI interface correctly, including those of the add-on config menu, the videos information, etc...
In other words, everything works fine on the add-on except when you make use of the enhanced download feature on an French KODI system. As this lovely feature isn't so widely used as the videos reproduction (i.e. the most common use of the add-on), i guess that's the reason why this issue has been somehow hidden till now.
I've tried to make use of the strings encode/decode methods on the plugin.get_string calls passed to plugin.notify as second argument on lines 209, 216 and 218 of addon.py file, without success (i.e. in the sort of plugin.get_string(3000X).encode('utf-8') etc..), so as a workaround i've removed the accentuated chars on the localized strings 30007 up to 30010. I know this is far from an elegant solution, but at least it keeps the add-on completely functional.
I've just opened this issue to let you know of the problem so you can take in mind for future releases of the add-on. I'm aware that the python unicode internals when dealing with other character encodings has caused more than a headache in the past even to skilled python programmers. On the other hand, i've talked of the accents problem with native spoken french peopled and they assured me that on digital supported media (like those of computers and/or digital devices), the lack of accentuated messages on the user interface is a common accepted rule.
I take the chance to say that i use your add-on on a daily basis from its beginnings, and i really appreciate all your effort and time in providing this wonderful add-on as is.
Yours sincerely,
jamontes.