diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-07-12 13:39:54 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-07-12 13:39:54 +0200 |
commit | 9b3d6ccaf321a44a0f6b9570be099ec465f79faa (patch) | |
tree | b5e76f686bdb51d4cd4d8d5b8507c4c04687a8d6 /pyload/utils/__init__.py | |
parent | fixed addon related bugs (diff) | |
download | pyload-9b3d6ccaf321a44a0f6b9570be099ec465f79faa.tar.xz |
working multihoster addon
Diffstat (limited to 'pyload/utils/__init__.py')
-rw-r--r-- | pyload/utils/__init__.py | 23 |
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: |