> General file encoding ways

We most know, computer stores files with binary coding like abc\xe4\xbd\xa0\xe5\xa5\xbd\xef\xbc\x81.

Generally, we do have some ways to encoding a file to solve other character excluding English which can'd be encoding. Like below:

  • unicode : At least use 16 bytes.
  • utf-8 : A compress set of unicode, use less space to store encoding code.
  • GBK : Specific for Chinese words.
  • GB2312 : Old version for Chinese words.
  • etc.

> How encoding works?

When we see below picture, we could know every coding set is the sub-set of unicode.

  • Every coding set is the sub-set of unicode.
  • Every coding set can convert between itself and unicode rather than with the reset of them.
  • *Of all the sub-set coding sets, they are based on ASCII code. So for English, there are no difference in using each of them.

  • We must point to a way to encoding/decoding a file.
  • Be ware of where is the location(hardware OR memory) regarding the content you are seeing.

> See some examples

When you download a file which are binary code with specific encoding(like utf-8) off a site, you have to use the corresponding decoding set(Here is utf-8) to see the content of it.
Opening a file between the .open('a.txt', encoding='utf-8') method in Python and the opening with pycharm(See the far right-bottom decoding indicator) are the fuck same essentially.
In the notepad++, we can choose different way to encoding/decoding a file.

> what's next?

Thinking in file encoding and decoding?的更多相关文章

  1. ios Object Encoding and Decoding with NSSecureCoding Protocol

    Object Encoding and Decoding with NSSecureCoding Protocol February 27, 2014 MISC NSCoding is a fanta ...

  2. Direct Access to Video Encoding and Decoding

    来源:http://asciiwwdc.com/2014/sessions/513   Direct Access to Video Encoding and Decoding  Session 5 ...

  3. eclipse的使用-------Text File Encoding没有GBK选项的设置

    eclipse的使用-------Text File Encoding没有GBK选项的设置 2013-12-25 09:48:06 标签:java myeclipse使用 有一个项目是使用GBK编码的 ...

  4. file.encoding到底指的是什么呢?

    转载请注明来源:http://blog.csdn.net/loongshawn/article/details/50918506 <Java利用System.getProperty(“file. ...

  5. 系统变量file.encoding对Java的运行影响有多大?(转)good

    这个话题来自: Nutz的issue 361 在考虑这个issue时, 我一直倾向于使用系统变量file.encoding来改变JVM的默认编码. 今天,我想到, 这个系统变量,对JVM的影响到底有多 ...

  6. readAsDataURL(file) & readAsText(file, encoding)

      readAsDataURL(file)会把文件内容转换为data类型的URL: data:text/plain;base64,b3JkZXItaWQJb3JkZXItaXRlbS1p... 这种d ...

  7. Android studio 配置file encoding 无效,中文乱码解决办法

    通过配置Android studio 配置file encoding 无效,中文乱码,问题出现在java编译的时候jack采用了默认编码(中文windows默认的GBK编码)而乱码,所以不管更改bui ...

  8. Jenkins maven 构建乱码,修改file.encoding系统变量编码为UTF-8

    一切都是windows的控制台默认编码GBK问题 情景: 使用jenkins构建,console 输出的中文乱码.代码编码格式是utf-8,因为Jenkins会默认读取当前系统的编码格式,导致构建日志 ...

  9. jenkins使用slave报编码错误[WARNING] File encoding has not been set, using platform encoding ANSI_X3.4-1968, i.e. build is platform dependent!

    jenkins:master-slave 模式: master编码配置: slave编码配置: 可以看出master 和 slave的配置是一样的,但是当项目在slave上执行的时候,偶尔会报如下错误 ...

随机推荐

  1. mysql修改时区的几种方法(转载自https://www.cnblogs.com/shiqiangqiang/p/8393662.html)

    说明: 以下记录修改mysql时区的几种方法. 具体: 方法一:通过mysql命令行模式下动态修改 1.1 查看mysql当前时间,当前时区 select curtime(); #或select no ...

  2. 铁大FaceBook的使用体验

    铁大FaceBook是一个类似QQ和微信等聊天程序的缩小版网站,并且其针对领域较为狭窄:即只针对校园的学生和导员等人员.但其有值得推广的潜力性和可能性. 对于使用它的体验:第一点我感觉这个网站的界面很 ...

  3. [luogu 1270] “访问”美术馆 (树形dp)

    传送门 Description 经过数月的精心准备,Peer Brelstet,一个出了名的盗画者,准备开始他的下一个行动.艺术馆的结构,每条走廊要么分叉为两条走廊,要么通向一个展览室.Peer知道每 ...

  4. JavaScript原生值与JSON的转换

    ---------------------------------- ---------------------------- stringify方法的另外两种参数: ---------------- ...

  5. 利用Selenium实现图片文件上传的两种方式介绍

    在实现UI自动化测试过程中,有一类需求是实现图片上传,这种需求根据开发的实现方式,UI的实现方式也会不同. 一.直接利用Selenium实现 这种方式是最简单的一种实现方式,但是依赖于开发的实现. 当 ...

  6. BA-闭式冷却塔系统

  7. iframe显示滚动栏

    子页面通过iframe载入.出现了竖向滚动栏 最后查出原因:文档申明 iframe有滚动栏的页面的文档申明 <!DOCTYPE html> 改成例如以下即可了 <!DOCTYPE H ...

  8. angularjs1-4 事件指令

    <div ng-app="myApp"> <div ng-controller="firstController"> <div n ...

  9. 请求测试——Fiddler2工具(可以测试POST和Get)

    使用参考:http://jingyan.baidu.com/article/dca1fa6fa07000f1a44052f6.html 发送POST请求的时候,需要填写发送类型: 发送JSON格式填写 ...

  10. layer Tips参数使用

    layer.tips(content, follow, options) - tips层type:4的深度定制.也是我本人比较喜欢的一个层类型,因为它拥有和msg一样的低调和自觉,而且会智能定位,即灵 ...