我看到像 Django 这样的框架到处都在使用 unicode,所以这似乎是个好主意。
另一方面,让所有这些额外的“你”到处漂浮似乎是一件很痛苦的事情。
如果我不这样做会有什么问题?
如果我这样做会出现什么问题吗?
我现在正在使用 Pylons 作为我的框架。
最佳答案
您可以通过以下方式避免 python 2.6 中的 u''
:
from __future__ import unicode_literals
这将使 'string literals'
成为 unicode 对象,就像在 python 3 中一样;
关于python - 我的 python 网络应用程序是否应该对所有字符串使用 unicode?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/827415/