Add-ons: Unicode characters in user data path
#1
Hello all.

On my XBMC 11 installation (Windows 7), many add-ons give "error script failed" when starting. But some add-ons work fine.

After investigating, I found out that it was because my Windows 7 user folder (my name!) has a "é" character in it, which is quite normal in many languages.

I created a new Windows user account without this character and all add-ons work fine.

I know I could try to rename this folder, but it is quite involved and I don't want to mess all my system. It sure can be handled on the software side since some add-ons do work well.

How should I handle this? Do I need to inform each add-on developer?

Thank you for your help.
Reply
#2
Thats bad.

For the quickest solution I would suggest using xbmc in portable Mode:

Just add " -p" to your xbmc start shortcut, then xbmc will create a "portable_data" folder down to the installation folder. After this folder is created you could exit xbmc and copy all your data (userdata, addons, ...) to this folder to get all your settings back.

But best would be if you would ping all addon-authors to fix that (including me if my addons fail *g*).

regards,
sphere
My GitHub. My Add-ons:
Image
Reply
#3
Nice quick suggestion. Have made it portable and it works. Will try to inform the addon authors when possible.
Much thanks!
Reply
#4
fpqc Wrote:Nice quick suggestion. Have made it portable and it works. Will try to inform the addon authors when possible.
Much thanks!

No problem. If you have the time I would be happy if you could check my addons as well *g*

All are present in the official addon repo and are listed in my signature.

regards,
sphere
My GitHub. My Add-ons:
Image
Reply
#5
Hey,

As a programmer and a python programmer, I found the core of the problem.
Using encode and decode methods isn't ideal. The issue still exists.

After examining the log output, I realized how simple is the problem:

There was file not found exception for (the sample below is fake and just for shows):
C:\Users\\u323 u\232 u\232\AppData\Roaming\Kodi

Python turned Unicode data into those u\<Unicode number> instead of actual once.

In simple English:
Addons and stuff are unable to find the directory of the user data because the user name Unicode was switched and replaced with something else (Python's ASCII).

I have one solution on my mind right now: Do the same as SMTP protocol does for E-Mail messages to send their Unicode messages as ASCII; Use Base64 to pass over the argument of the user data directory (If you are unfamiliar with Base64, basically it encodes any binary data, [text/strings included] into ASCII text that later can be decoded back to its original binary form - best way to keep data the way it was originated)

I wanted to fix it myself but was unable to find in the code where getAddonInfo('path') method is implemented..
Reply
#6
The function getAddonInfo(...) is implemented at https://github.com/xbmc/xbmc/blob/6af40c...#L108-L140
Reply
#7
(2017-04-06, 21:07)Rechi Wrote: The function getAddonInfo(...) is implemented at https://github.com/xbmc/xbmc/blob/6af40c...#L108-L140

Thanks for the reply. It turns out I need to find now the implementation of:
pAddon->Path()


After I failed again.. Came back here.
Is there a way / method to know where to find anything? I digged the source files but maybe it's just me not too familiar with CPP :`-(
Reply
#8
https://github.com/xbmc/xbmc/blob/f9de66...don.h#L106

Mostly I use the commandline tool grep to find methods, but it may not be your preferred way to use the command line.
Reply
#9
I guess I am missing something, as I thought the xbmc implemented functions return utf-8 encoded byte strings. The programmer should decode these into Python unicode, and ensure all opeations are using unicode-compatible code/functions. Then encoded back into utf-8 when passed to xbmc functions.

scott s.
.
Reply

Logout Mark Read Team Forum Stats Members Help
Add-ons: Unicode characters in user data path0