From 9164dafe6932d032813d33eb963941c7cfbf1606 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Thu, 29 Jun 2017 14:19:50 +0100 Subject: [PATCH] [#3083] Fix missing common.utf8_encoded for backward compatibility --- deluge/common.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deluge/common.py b/deluge/common.py index e6b633d82..e9afba688 100644 --- a/deluge/common.py +++ b/deluge/common.py @@ -28,6 +28,7 @@ import time import chardet import pkg_resources +from deluge.decorators import deprecated from deluge.error import InvalidPathError try: @@ -921,6 +922,11 @@ def decode_bytes(byte_str, encoding='utf8'): return '' +@deprecated +def utf8_encoded(s, encoding='utf8'): + decode_bytes(s, encoding).encode('utf8') + + def utf8_encode_structure(data): """Recursively convert all unicode keys and values in a data structure to utf8.