From 51b99caf24a3c2e30ed8f0a78fbef8db46d74494 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Thu, 29 Jun 2017 15:28:52 +0100 Subject: [PATCH] [Common] Add decode_string (deprecated) for compatibility --- deluge/common.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/deluge/common.py b/deluge/common.py index e9afba688..64d76b685 100644 --- a/deluge/common.py +++ b/deluge/common.py @@ -923,8 +923,15 @@ def decode_bytes(byte_str, encoding='utf8'): @deprecated -def utf8_encoded(s, encoding='utf8'): - decode_bytes(s, encoding).encode('utf8') +def decode_string(byte_str, encoding='utf8'): + """Deprecated: Use decode_bytes""" + decode_bytes(byte_str, encoding) + + +@deprecated +def utf8_encoded(str_, encoding='utf8'): + """Deprecated: Use encode or decode_bytes if needed""" + decode_bytes(str_, encoding).encode('utf8') def utf8_encode_structure(data):