Update regarding #545

This commit is contained in:
Miroslav Stampar
2019-04-18 11:52:33 +02:00
parent bc5b643700
commit 0f697418d9
3 changed files with 8 additions and 7 deletions

View File

@@ -2431,11 +2431,11 @@ def getUnicode(value, encoding=None, noneToNull=False):
except UnicodeDecodeError:
return six.text_type(str(value), errors="ignore") # encoding ignored for non-basestring instances
def getASCII(value):
def getBytes(value):
"""
Returns ASCII representation of provided Unicode value
Returns byte representation of provided Unicode value
>>> getASCII(getUnicode("foo\x01\x83\xffbar")) == "foo\x01\x83\xffbar"
>>> getBytes(getUnicode("foo\x01\x83\xffbar")) == "foo\x01\x83\xffbar"
True
"""