How to convert unicode to its original character in Python

Xufeng

I first tried typing in a Unicode character, encode it in UTF-8, and decode it back. Python happily gives back the original character. I took a look at the encoded string, it is b'\xe6\x88\x91'. I don't understand what this is, it looks like 3 hex numbers.

Then I did some research and I found that the CJK set starts from 4E00, so now I want Python to show me what this character looks like. How do I do that? Do I need to convert 4E00 to the form of something like the one above?

Daniel

The text b'\xe6\x88\x91' is the representation of the bytes that are the utf-8 encoding of the unicode codepoint \u6211 which is the character 我. So there is no need in converting something, other than to a unicode string with .decode('utf-8').

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How do filter and convert unicode to integer in python

분류에서Dev

In bash, how can I convert a Unicode Codepoint [0-9A-F] into a printable character?

분류에서Dev

how to convert a character array to decibel

분류에서Dev

Get UTF-8 character codes from Python unicode string

분류에서Dev

python 3, unicode conversion, two \u0000 as one character

분류에서Dev

How to keep image in its original place while rotating

분류에서Dev

How to convert a verb to its (derived) noun form?

분류에서Dev

How to convert decimal value to character in c language

분류에서Dev

How do I convert (.gif to .png) this image to get the original view?

분류에서Dev

How do I convert a list of strings to a unicode value?

분류에서Dev

convert emoticons to unicode

분류에서Dev

Convert string saved in hex format to its previous form in python

분류에서Dev

Unicode Character 'BULLET' in Titanium App

분류에서Dev

Delete weird ANSI character and convert accented ones using Python

분류에서Dev

How do I call the parent classes constructor with its original parameters in PHP

분류에서Dev

How do I get my USB back to its original settings after using as a live usb?

분류에서Dev

Getting the value as object how to convert it to string and retrieve its value

분류에서Dev

How to convert a json string into an individual character array in bash?

분류에서Dev

How do I convert a TTF into individual PNG character images?

분류에서Dev

How to reorder a list in Python based on its content

분류에서Dev

convert character set (German)

분류에서Dev

Backtrack each record to its original state in sql

분류에서Dev

How to convert an urlopen into a string in python

분류에서Dev

How to convert dict to expressions in python

분류에서Dev

Python에서 search_character를 original_string 대신 대체하는 방법

분류에서Dev

Saving a new unicode character in microsoft word

분류에서Dev

PHP Array Convert its format

분류에서Dev

UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode

분류에서Dev

convert character linestring to geometry in sf

Related 관련 기사

  1. 1

    How do filter and convert unicode to integer in python

  2. 2

    In bash, how can I convert a Unicode Codepoint [0-9A-F] into a printable character?

  3. 3

    how to convert a character array to decibel

  4. 4

    Get UTF-8 character codes from Python unicode string

  5. 5

    python 3, unicode conversion, two \u0000 as one character

  6. 6

    How to keep image in its original place while rotating

  7. 7

    How to convert a verb to its (derived) noun form?

  8. 8

    How to convert decimal value to character in c language

  9. 9

    How do I convert (.gif to .png) this image to get the original view?

  10. 10

    How do I convert a list of strings to a unicode value?

  11. 11

    convert emoticons to unicode

  12. 12

    Convert string saved in hex format to its previous form in python

  13. 13

    Unicode Character 'BULLET' in Titanium App

  14. 14

    Delete weird ANSI character and convert accented ones using Python

  15. 15

    How do I call the parent classes constructor with its original parameters in PHP

  16. 16

    How do I get my USB back to its original settings after using as a live usb?

  17. 17

    Getting the value as object how to convert it to string and retrieve its value

  18. 18

    How to convert a json string into an individual character array in bash?

  19. 19

    How do I convert a TTF into individual PNG character images?

  20. 20

    How to reorder a list in Python based on its content

  21. 21

    convert character set (German)

  22. 22

    Backtrack each record to its original state in sql

  23. 23

    How to convert an urlopen into a string in python

  24. 24

    How to convert dict to expressions in python

  25. 25

    Python에서 search_character를 original_string 대신 대체하는 방법

  26. 26

    Saving a new unicode character in microsoft word

  27. 27

    PHP Array Convert its format

  28. 28

    UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode

  29. 29

    convert character linestring to geometry in sf

뜨겁다태그

보관