Skip to content
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

Handle unicode in a more transparent way #102

Closed
mediaminister opened this issue Aug 27, 2019 · 1 comment · Fixed by #169
Closed

Handle unicode in a more transparent way #102

mediaminister opened this issue Aug 27, 2019 · 1 comment · Fixed by #169
Assignees
Milestone

Comments

@mediaminister
Copy link
Collaborator

mediaminister commented Aug 27, 2019

InputStreamHelper is used by people using different languages and alphabets on a wide variety of different systems and Kodi versions. So, it's important our add-on supports all unicode characters and maintain compatibility with Python 2 and Python 3 Kodi versions for all these users.

Today we use kodi_six to handle unicode for the Kodi Python API and we use unicode_literals and use the encoding declaration # -*- coding: utf-8 -*- to make sure we always use unicode throughout the add-on source code.
But, sometimes we need to convert unicode to bytestrings and vice-versa.
For instance os.walk in Python 2 which doesn't support unicode flawlessly.
Or for instance when importing or exporting text from external sources like the internet or a filesystem.

Using different external libraries handling unicode makes it very difficult to transparently and consciously handle unicode. For a next version we should think about removing kodi_six and handling unicode encoding and decoding using our own Python2/3 compatible conversion functions.

We did this before in the VRT NU add-on and this helps us transparently maintaining Python2/3 and unicode support: https://github.com/pietje666/plugin.video.vrt.nu/blob/8cd3304f859e2febaf9f89be91a0da3cc3ed329d/resources/lib/statichelper.py#L71-L81

@mediaminister
Copy link
Collaborator Author

I'm working on this, but to reliable test unicode support on Windows and Kodi Python 3, there are fixes needed upstream.
There is already one fix for Kodi Python 3 for Windows users with unicode characters in their user profile path: xbmc/xbmc#16577
But now I bump into a possible bug in InputStream Adaptive...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants