summaryrefslogtreecommitdiffstats
path: root/pyload/utils/__init__.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-07-12 13:39:54 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-07-12 13:39:54 +0200
commit9b3d6ccaf321a44a0f6b9570be099ec465f79faa (patch)
treeb5e76f686bdb51d4cd4d8d5b8507c4c04687a8d6 /pyload/utils/__init__.py
parentfixed addon related bugs (diff)
downloadpyload-9b3d6ccaf321a44a0f6b9570be099ec465f79faa.tar.xz
working multihoster addon
Diffstat (limited to 'pyload/utils/__init__.py')
-rw-r--r--pyload/utils/__init__.py23
1 files changed, 9 insertions, 14 deletions
diff --git a/pyload/utils/__init__.py b/pyload/utils/__init__.py
index ca00f9abe..da7b81af7 100644
--- a/pyload/utils/__init__.py
+++ b/pyload/utils/__init__.py
@@ -19,25 +19,20 @@ json_loads = json.loads
json_dumps = json.dumps
def decode(string):
- """ decode string with utf if possible """
- try:
- if type(string) == str:
- return string.decode("utf8", "replace")
- else:
- return string
- except:
+ """ decode string to unicode with utf8 """
+ if type(string) == str:
+ return string.decode("utf8", "replace")
+ else:
return string
def encode(string):
- """ decode string to utf if possible """
- try:
- if type(string) == unicode:
- return string.encode("utf8", "replace")
- else:
- return string
- except:
+ """ decode string to utf8 """
+ if type(string) == unicode:
+ return string.encode("utf8", "replace")
+ else:
return string
+
def remove_chars(string, repl):
""" removes all chars in repl from string"""
if type(string) == str: