Thinking in file encoding and decoding?
> 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?的更多相关文章
- ios Object Encoding and Decoding with NSSecureCoding Protocol
Object Encoding and Decoding with NSSecureCoding Protocol February 27, 2014 MISC NSCoding is a fanta ...
- Direct Access to Video Encoding and Decoding
来源:http://asciiwwdc.com/2014/sessions/513 Direct Access to Video Encoding and Decoding Session 5 ...
- eclipse的使用-------Text File Encoding没有GBK选项的设置
eclipse的使用-------Text File Encoding没有GBK选项的设置 2013-12-25 09:48:06 标签:java myeclipse使用 有一个项目是使用GBK编码的 ...
- file.encoding到底指的是什么呢?
转载请注明来源:http://blog.csdn.net/loongshawn/article/details/50918506 <Java利用System.getProperty(“file. ...
- 系统变量file.encoding对Java的运行影响有多大?(转)good
这个话题来自: Nutz的issue 361 在考虑这个issue时, 我一直倾向于使用系统变量file.encoding来改变JVM的默认编码. 今天,我想到, 这个系统变量,对JVM的影响到底有多 ...
- readAsDataURL(file) & readAsText(file, encoding)
readAsDataURL(file)会把文件内容转换为data类型的URL: data:text/plain;base64,b3JkZXItaWQJb3JkZXItaXRlbS1p... 这种d ...
- Android studio 配置file encoding 无效,中文乱码解决办法
通过配置Android studio 配置file encoding 无效,中文乱码,问题出现在java编译的时候jack采用了默认编码(中文windows默认的GBK编码)而乱码,所以不管更改bui ...
- Jenkins maven 构建乱码,修改file.encoding系统变量编码为UTF-8
一切都是windows的控制台默认编码GBK问题 情景: 使用jenkins构建,console 输出的中文乱码.代码编码格式是utf-8,因为Jenkins会默认读取当前系统的编码格式,导致构建日志 ...
- 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上执行的时候,偶尔会报如下错误 ...
随机推荐
- [置顶]
来自 HeroKu 的 HTTP API 设计指南(中文版)
转载:http://get.jobdeer.com/343.get 来自 HeroKu 的 HTTP API 设计指南(中文版) 翻译 by @Easy 简介 本指南中文翻译者为 @Easy ,他是国 ...
- HDU 4513 吉哥系列故事——完美队形II( Manacher变形 )
链接:传送门 思路:根据完美队形的定义,可以得知,完美队形实质上是 回文串 + 序列出现峰,因为是在回文串中再次增加了一个要求,所以可以对 Manacher 进行改造,改造的部分应该为暴力匹配的循环 ...
- 再见,OI(2019退役祭)
有些话应该藏在心里,有些事情只属于自己. (想了一下,自己的OI生涯.自己所经历的事情还是留在自己的心里吧,一是自己文笔不好,二是每个人的世界观不同对事情的看法不同) 不要轻易地去评价一个人,每个人背 ...
- 地图API示例
http://developer.baidu.com/map/jsdemo.htm#i6_2
- 【codeforces 731E】Funny Game
[题目链接]:http://codeforces.com/contest/731/problem/E [题意] 两个人轮流玩游戏; 取序列中的前k(k>1)个数字,拿出来; 把这k个数字全部加起 ...
- Spring学习总结(17)——Spring AOP权限管理
每个项目都会有权限管理系统 无论你是一个简单的企业站,还是一个复杂到爆的平台级项目,都会涉及到用户登录.权限管理这些必不可少的业务逻辑.有人说,企业站需要什么权限管理阿?那行吧,你那可能叫静态页面,就 ...
- BA--湿球温度和干球温度的区别
关于湿球温度和干球温度的区别: 干湿球温度表:用一对并列装置的.形状完全相同的温度表,一支测气温,称干球温度表,另一支包有保持浸透蒸馏水的脱脂纱布,称湿球温度表.当空气未饱和时,湿球因表面蒸发需要消耗 ...
- POJ 1284
想了很久,只想到枚举的方法,估计会超时吧. 原来有这样一条性质:p为素数,则p有phi(p-1)个原根 Orz... #include <iostream> #include <cs ...
- android AChartEnginee解说之源代码框架解读
从上周把android ACHartEnginee的源代码check out出来后就一直在看这个东西是怎样使用的,以及底层是怎样实现的,把近期一周对这个东西的了解先发上来,即是给自己做一个总结,也希望 ...
- MFC窗口去边框、置顶、全屏、激活
静态移除长提边框非常easy,直接设置"Border"属性为"none"就可以 "Maximize Box", "Minimize ...