kodi-send path and filename encoding problem
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:

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):

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>
  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:

LibreELEC:~ # locale

Can anyone suggest a solution?

Thanks in advance!

Logout Mark Read Team Forum Stats Members Help
kodi-send path and filename encoding problem0
This forum uses Lukasz Tkacz MyBB addons.