2012-05-29, 16:15
OK for \ and \\ but I got an other issue with accent
File on my PC :
C:\Photos\Août 2010.jpg
This path is stored on CommonCache and when I request CommonCache, I get UTF-8 String I suppose :
But if I want to add this path to Playlist with this code :
I get an error :
I gess that JSON don't want UTF-8 string as if I call JSON this way :
File is added to Playlist and played.
I've tried many things to encode/decode path from UTF-8 to ASCII or LATIN1 but now I'm lost and I don't know what to do
File on my PC :
C:\Photos\Août 2010.jpg
This path is stored on CommonCache and when I request CommonCache, I get UTF-8 String I suppose :
Code:
u'C:\\Photos\\Ao\xfbt 2010.jpg'
But if I want to add this path to Playlist with this code :
Code:
xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Playlist.Add", "params": {"playlistid": 2, "item": {"file" : "%s"}}, "id": 1}' %(_path))
I get an error :
Code:
Error Contents: 'ascii' codec can't encode character u'\xfb' in position 106: ordinal not in range(128)
I gess that JSON don't want UTF-8 string as if I call JSON this way :
Code:
xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Playlist.Add", "params": {"playlistid": 2, "item": {"file" : "C:\\\\Photos\\\\Août 2010.jpg"}}, "id": 1}')
File is added to Playlist and played.
I've tried many things to encode/decode path from UTF-8 to ASCII or LATIN1 but now I'm lost and I don't know what to do