Vie*_*iet 11 python google-app-engine case-conversion
我使用谷歌应用程序引擎,不能使用任何C/C++扩展,只有纯和pythonic库来转换Unicode/UTF-8字符串到大/小写.str.lower()和string.lowercase()没有.
Ign*_*ams 24
str以UTF-8编码,unicode是两种不同的类型.不要使用string,在unicode对象上使用适当的方法:
>>> print u'?'.upper()
?
Run Code Online (Sandbox Code Playgroud)
使用之前解码str为unicode:
>>> print '?'.decode('utf-8').upper()
?
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14677 次 |
| 最近记录: |