[Common] Add decode_string (deprecated) for compatibility

This commit is contained in:
Calum Lind 2017-06-29 15:28:52 +01:00
parent 850fd34522
commit 51b99caf24
1 changed files with 9 additions and 2 deletions

View File

@ -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):