You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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...
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 useunicode_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
The text was updated successfully, but these errors were encountered: