Python: getting correct string length when it contains surrogate pairs

前端 未结 3 557
太阳男子
太阳男子 2021-01-04 04:42

Consider the following exchange on IPython:

In [1]: s = u\'華袞與緼         


        
3条回答
  •  春和景丽
    2021-01-04 05:21

    I think this has been fixen in 3.3. See:

    http://docs.python.org/py3k/whatsnew/3.3.html
    http://www.python.org/dev/peps/pep-0393/ (search for wstr_length)

提交回复
热议问题