In strings (or Unicode objects in Python 2), u
has a special meaning, namely saying, "here comes a Unicode character specified by it's Unicode ID". Hence u"u0432"
will result in the character в.
The b''
prefix tells you this is a sequence of 8-bit bytes, and bytes object has no Unicode characters, so the u
code has no special meaning. Hence, b"u0432"
is just the sequence of the bytes
,u
,0
,4
,3
and 2
.
Essentially you have an 8-bit string containing not a Unicode character, but the specification of a Unicode character.
You can convert this specification using the unicode escape encoder.
>>> c.decode('unicode_escape')
'в'
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…