What encoding do normal python strings use?

前端 未结 6 1995
太阳男子
太阳男子 2020-12-03 08:08

i know that django uses unicode strings all over the framework instead of normal python strings. what encoding are normal python strings use ? and why don\'t they use unicod

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-03 08:24

    Python 2.x strings are 8-bit, nothing more. The encoding may vary (though ASCII is assumed). I guess the reasons are historical. Few languages, especially languages that date back to the last century, use unicode right away.

    In Python 3, all strings are unicode.

提交回复
热议问题