What is internal representation of string in Python 3.x

后端 未结 8 1070
逝去的感伤
逝去的感伤 2020-12-03 13:43

In Python 3.x, a string consists of items of Unicode ordinal. (See the quotation from the language reference below.) What is the internal representation of Unicode string? I

8条回答
  •  萌比男神i
    2020-12-03 14:11

    I think, Its hard to judge difference between UTF-16, which is just a sequences of 16 bit words, to Python's string object.

    And If python is compiled with Unicode=UCS4 option, it will be comparing between UTF-32 and Python string.

    So, better consider, they are in different category, although you can transform each others.

提交回复
热议问题