mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
'backslashreplace' makes no sense for str.decode()
This commit is contained in:
parent
128005e889
commit
09556d5fbc
1 changed files with 2 additions and 2 deletions
|
@ -42,13 +42,13 @@ if sys.hexversion >= 0x3000000:
|
||||||
def b2str(s, enc=None):
|
def b2str(s, enc=None):
|
||||||
"""Convert a Bytes string to native Python 3 str."""
|
"""Convert a Bytes string to native Python 3 str."""
|
||||||
return s.decode(getattr(enc, 'encoding', enc) or 'utf8',
|
return s.decode(getattr(enc, 'encoding', enc) or 'utf8',
|
||||||
'backslashreplace')
|
'replace')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
def str2u(s, enc=None):
|
def str2u(s, enc=None):
|
||||||
"""Convert a native Python2 str to Unicode."""
|
"""Convert a native Python2 str to Unicode."""
|
||||||
return s.decode(getattr(enc, 'encoding', enc) or 'utf8',
|
return s.decode(getattr(enc, 'encoding', enc) or 'utf8',
|
||||||
'backslashreplace')
|
'replace')
|
||||||
|
|
||||||
def str2b(s, enc=None):
|
def str2b(s, enc=None):
|
||||||
"""Convert a native Python2 str to bytes. This is a NOP."""
|
"""Convert a native Python2 str to bytes. This is a NOP."""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue