diff --git a/changelog.txt b/changelog.txt index 35b7a11..3becb42 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,8 @@ Version 0.4.5 added version info to logs +added try/catch for unicode errors + Version 0.4.4 modified the check for invalid file types diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 2a94547..8d1d1c8 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -29,4 +29,11 @@ def getString(string_id): return __Addon.getLocalizedString(string_id) def encode(string): - return string.encode('UTF-8','replace') + result = '' + + try: + result = string.encode('UTF-8','replace') + except UnicodeDecodeError: + result = 'Unicode Error' + + return result