关于UTF字符码

关于UTF字符码

关于UTF字符码


在ex9.py中,因为同事在学Espaol,于是装了下,把星期和月份改成了Spanish。结果不显示,然后开头加了# -*- coding:utf-8 -*- 转换,可以运行显示,但是 é都显示了乱码。改成utf-16或者32都不行。


代码:


# -*- coding:utf-8 -*-

#here's some new strange stuff, remember type it exactly.


days = "lunes martes miércoles jueves viernes sábado domingo"

months = "\nenero\nfebrero\nmarzo\nabril\nmayo\njunio\njulio\nagosto\nseptiembre\noctubre\nnoviembre\ndiciembre"


print "Here are the days: ", days

print "Here are the months: ", months


print """

There's something going on here.

With the three double-quotes.

We'll be able to type as much as we like.

Even 4 lines if we want,or 5, or 6.

"""





SO,对于拉丁字符,比如 é这类英语中没有的怎么正常显示呢?

或者加个 %r 转换行不行呢?

下次尝试。