From d5097fb73a46a564b15b7bffb5eb6b5158b79863 Mon Sep 17 00:00:00 2001
From: angelblue05 <tamara.angel05@gmail.com>
Date: Thu, 14 Jun 2018 16:24:28 -0500
Subject: [PATCH] Fix external subs

Encode url for non ascii chars
---
 resources/lib/playutils.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/resources/lib/playutils.py b/resources/lib/playutils.py
index 7eba3454..da1c1b64 100644
--- a/resources/lib/playutils.py
+++ b/resources/lib/playutils.py
@@ -138,7 +138,7 @@ class PlayUtils():
         '''
 
         # Log filename, used by other addons eg subtitles which require the file name
-        window('embyfilename', value=self.get_direct_path(source))
+        window('embyfilename', value=self.get_direct_path(source).encode('utf-8'))
 
         if (not self.force_transcode and (self.is_strm(source) or self.is_h265(source) or (settings('playFromStream') == "false" and self.is_file_exists(source)))):
             # Append external subtitles
@@ -359,7 +359,7 @@ class PlayUtils():
                 mapping[kodi_index] = index
                 kodi_index += 1
 
-        window('emby_%s.indexMapping.json' % play_url, value=mapping)
+        window('emby_%s.indexMapping.json' % play_url.encode('utf-8'), value=mapping)
         self.listitem.setSubtitles(subs)
 
         return