Unicode vs UTF-8 confusion in Python / Django?

前端 未结 5 1992
渐次进展
渐次进展 2020-12-14 00:53

I stumbled over this passage in the Django tutorial:

Django models have a default str() method that calls unicode()

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-14 01:26

    Meanwhile, I did a refined research to verify what the internal representation in Python is, and also what its limits are. "The Truth About Unicode In Python" is a very good article which cites directly from the Python developers. Apparently, internal representation is either UCS-2 or UCS-4 depending on a compile-time switch. So Jon, it's not UTF-16, but your answer put me on the right track anyway, thanks.

提交回复
热议问题