From acff5085abe91106cb358d165f59ec4be3915439 Mon Sep 17 00:00:00 2001
From: Luca <l.dimarino@gmail.com>
Date: Wed, 8 May 2013 12:53:15 +0200
Subject: [PATCH] Fix unicode characters as well as other unicode issues

---
 sickbeard/helpers.py           |  7 ++++---
 sickbeard/show_name_helpers.py | 11 ++++++-----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py
index 1393ad847..ce5ac1b45 100644
--- a/sickbeard/helpers.py
+++ b/sickbeard/helpers.py
@@ -609,7 +609,8 @@ def chmodAsParent(childPath):
         logger.log(u"No parent path provided in "+childPath+", unable to get permissions from it", logger.DEBUG)
         return
     
-    parentMode = stat.S_IMODE(os.stat(parentPath)[stat.ST_MODE])
+    parentPathStat = ek.ek(os.stat, parentPath)
+    parentMode = stat.S_IMODE(parentPathStat[stat.ST_MODE])
     
     childPathStat = ek.ek(os.stat, childPath)
     childPath_mode = stat.S_IMODE(childPathStat[stat.ST_MODE])
@@ -647,7 +648,7 @@ def fixSetGroupID(childPath):
         return
 
     parentPath = ek.ek(os.path.dirname, childPath)
-    parentStat = os.stat(parentPath)
+    parentStat = ek.ek(os.stat, parentPath)
     parentMode = stat.S_IMODE(parentStat[stat.ST_MODE])
 
     if parentMode & stat.S_ISGID:
@@ -783,4 +784,4 @@ def md5_for_file(filename, block_size=2**16):
             f.close()
             return md5.hexdigest()
     except Exception:
-        return None
\ No newline at end of file
+        return None
diff --git a/sickbeard/show_name_helpers.py b/sickbeard/show_name_helpers.py
index 9797c612a..e2a74ef47 100644
--- a/sickbeard/show_name_helpers.py
+++ b/sickbeard/show_name_helpers.py
@@ -16,18 +16,18 @@
 # You should have received a copy of the GNU General Public License
 # along with Sick Beard.  If not, see <http://www.gnu.org/licenses/>.
 
-import sickbeard
+import re
+import datetime
 
+import sickbeard
 from sickbeard.common import countryList
 from sickbeard.helpers import sanitizeSceneName
 from sickbeard.scene_exceptions import get_scene_exceptions
 from sickbeard import logger
 from sickbeard import db
-
-import re
-import datetime
-
 from name_parser.parser import NameParser, InvalidNameException
+from lib.unidecode import unidecode
+
 
 resultFilters = ["sub(pack|s|bed)", "nlsub(bed|s)?", "swesub(bed)?",
                  "(dir|sample|nfo)fix", "sample", "(dvd)?extras", 
@@ -206,6 +206,7 @@ def isGoodResult(name, show, log=True):
 
     all_show_names = allPossibleShowNames(show)
     showNames = map(sanitizeSceneName, all_show_names) + all_show_names
+    showNames += map(unidecode, all_show_names) 
 
     for curName in set(showNames):
         escaped_name = re.sub('\\\\[\\s.-]', '\W+', re.escape(curName))
-- 
GitLab