diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-01-22 12:30:16 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-01-22 12:30:16 +0100 |
commit | 66f817d6d1fa24713b556982a0de209f3322e868 (patch) | |
tree | 642bfd6e9f4a47e3844c98617c8937e1cdec2fd0 /module/utils | |
parent | return pid for uploadContainer (diff) | |
download | pyload-66f817d6d1fa24713b556982a0de209f3322e868.tar.xz |
realdebrid encoding fix
Diffstat (limited to 'module/utils')
-rw-r--r-- | module/utils/__init__.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/module/utils/__init__.py b/module/utils/__init__.py index bf11fbc69..592bdbd7e 100644 --- a/module/utils/__init__.py +++ b/module/utils/__init__.py @@ -19,6 +19,16 @@ def decode(string): except: 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: + return string + def remove_chars(string, repl): """ removes all chars in repl from string""" if type(string) == str: |