Python Undo Unicode

前端 未结 1 1034
-上瘾入骨i
-上瘾入骨i 2020-12-22 04:11

Let\'s say I have the following two variables:

bob1 = u\'bob\\xf0\\xa4\\xad\\xa2\'

bob2 = \'bob\\xf0\\xa4\\xad\\xa2\'

How can I get the va

相关标签:
1条回答
  • 2020-12-22 04:38

    Code points between U+0000 and U+00FF map to the same byte value in the ISO 8859-1 or Latin 1 encodings.

    >>> u'bob\xf0\xa4\xad\xa2'.encode('latin-1')
    'bob\xf0\xa4\xad\xa2'
    
    0 讨论(0)
提交回复
热议问题