关于UTF字符码

发布时间:2020-07-12 17:58:42 作者:磁盘阵列
来源:网络 阅读:366

关于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 转换行不行呢?

下次尝试。












推荐阅读:
  1. 反转 UTF-8 编码的字符串
  2. 怎么在MySQL中将字符集utf8修改为utf8mb4

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

utf字符码

上一篇:linux C编程之常用文件I/O操作

下一篇:基础搭建Hadoop大数据处理-编程

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》