您好,登錄后才能下訂單哦!
關(guān)于UTF字符碼
在ex9.py中,因?yàn)橥略趯W(xué)Espaol,于是裝了下,把星期和月份改成了Spanish。結(jié)果不顯示,然后開頭加了# -*- coding:utf-8 -*- 轉(zhuǎn)換,可以運(yùn)行顯示,但是 é都顯示了亂碼。改成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,對(duì)于拉丁字符,比如 é這類英語中沒有的怎么正常顯示呢?
或者加個(gè) %r 轉(zhuǎn)換行不行呢?
下次嘗試。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。