kodi-send path and filename encoding problem
#1
Hi there

Not sure if this should go to RPi topic, I'll try here first

I'm using Libreelec 9.0.2 on RPi3 with Kodi 18.2.

I tried to use kodi-send to start video programatically, but had some trouble with non-english characters.

This works OK, video starts:

Code:
LibreELEC:~ # kodi-send --action="PlayMedia(/storage/videos/video.mp4)"
Sending: {'content': 'PlayMedia(/storage/videos/video.mp4)', 'type': 'action'}
However this isn't working (check the filenames):

Code:
LibreELEC:~ # kodi-send --action="PlayMedia(/storage/videos/videó.mp4)"
Sending: {'content': 'PlayMedia(/storage/videos/video\xcc\x81.mp4)', 'type': 'action'}
Traceback (most recent call last):
  File "/usr/bin/kodi-send", line 103, in <module>
    main()
  File "/usr/bin/kodi-send", line 94, in main
    packet = PacketACTION(actionmessage=action['content'], actiontype=ACTION_BUTTON)
  File "/usr/lib/python2.7/site-packages/kodi/xbmcclient.py", line 465, in __init__
    self.append_payload( format_string(actionmessage) )
  File "/usr/lib/python2.7/site-packages/kodi/xbmcclient.py", line 104, in format_string
    return msg.encode() + b"\0"
UnicodeDecodeError: 'ascii' codec can't decode byte 0xcc in position 51: ordinal not in range(128)

Python does not like non-ascii characters or something like that. Whitespaces neither.

Maybe some environment variable matters:

Code:
LibreELEC:~ # locale
LANG=
LC_CTYPE="POSIX"
LC_ALL=

Can anyone suggest a solution?

Thanks in advance!
Reply


Messages In This Thread
kodi-send path and filename encoding problem - by aboy - 2020-01-04, 16:13
Logout Mark Read Team Forum Stats Members Help
kodi-send path and filename encoding problem0