Python returns length of 2 for single Unicode char

2019-01-09 13:56发布

问题:

In Python 2.7:

In [2]: utf8_str = '\xf0\x9f\x91\x8d'
In [3]: print(utf8_str)