您好,登錄后才能下訂單哦!
關于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 轉換行不行呢?
下次嘗試。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。