Printing UTF-8-encoded byte string

前端 未结 2 1398
日久生厌
日久生厌 2021-01-20 00:52

I have a data of a form: v = \"\\xc5\\x84\"

This is a byte representation of an utf-8 encoded character \"ń\".

How can I print >>ń<< using

2条回答
  •  忘掉有多难
    2021-01-20 01:42

    Uhm, you don't need to do anything special... It's just print v?

    >>> v = "\xc5\x84"
    >>> print v
    ń
    

提交回复
热议问题