0

In python2.7 I got a unicode like this s = u'\xe5\x86\x80AC5S'. Actually it is a license plate include Chinese character and I had test the '\xe5\x86\x80', which is UTF-8 binary.

I got a solution that uses = s.encode('latin-1') then s == '\xe5\x86\x80AC5S',the solution explain Code points between U+0000 and U+00FF map to the same byte value in the ISO 8859-1 or Latin 1 encodings.

But now,I confuse the unicode storage mode. when I wirte a s = u'somedata',the ide get the defaultencoing(),my ide is utf-8,I think the s transformed unicode in utf-8,I mean s storage in hex not U+0000 way. Where do I understand wrong? Please help!!

KuLi
  • 1
  • 1

0 Answers0