[#3083] Fix missing common.utf8_encoded for backward compatibility

This commit is contained in:
Calum Lind 2017-06-29 14:19:50 +01:00
parent 33e9545cd4
commit 9164dafe69
1 changed files with 6 additions and 0 deletions

View File

@ -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.