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上执行的时候,偶尔会报如下错误 ...
随机推荐
- WEBGL学习【十二】鼠标操作场景
<!DOCTYPE HTML> <html lang="en"> <head> <title>Listing 7-3 and 7-4 ...
- 分治FFT/NTT 模板
题目要我们求$f[i]=\sum\limits_{j=1}^{i}f[i-j]g[j]\;mod\;998244353$ 直接上$NTT$肯定是不行的,我们不能利用尚未求得的项卷积 所以要用$CDQ$ ...
- php中文乱码处理方法
昨天在本地环境创建了一个文件,文件编码是UTF-8格式,打印一个简单的语句竟然出现了中文乱码,折腾了很久,才找到了原因. 乱码问题 昨天写了一个很简单的php输出中文页面,但是出现了乱码问题,第一反应 ...
- 【LeetCode-面试算法经典-Java实现】【120-Triangle(三角形)】
[120-Triangle(三角形)] [LeetCode-面试算法经典-Java实现][全部题目文件夹索引] 原题 Given a triangle, find the minimum path s ...
- Rails中关联数据表的添加操作(嵌套表单)
很早就听说有Web敏捷开发这回事,最近终于闲了下来,可以利用业余的时间学些新东西,入眼的第一个东东自然是Ruby on Rails.Rails中的核心要素也就是MVC.ORM这些了,因此关于Rails ...
- Registry Connect failed,Windows服务诊断
Message:Connection failed for 192.168.32.38_e-futrueserer. Details:Windows Registry Datasource: Regi ...
- SYN-Flood防御方法之一Synproxy
SYN-Flood攻击: 攻击者发送大量的SYN给服务器. 服务器必须针对每一个SYN请求回送一个SYN-ACK 应答包,此时服务器就必须保持一条半开放的连接,直到接收到一个对应的ACK应答包为止. ...
- 什么是jquery中的事件委派?
在jquery中有一个很重要的概念——事件委派,相信很多搞前端开发的人都听说过,零度逍遥本来对此不是十分理解,但经过一个高人的指点后,才发现这个功能还是蛮强大的,今天就给大家分享一下. 事件委派的定义 ...
- 基本类型转换成NSNumber类型
int i=100; float f=2.34; NSNumber *n1=[NSNumber numberWithInt:i]; NSNumber *n2=[NSNumber numberWithF ...
- linux 安装redis zookeeper
安装redis: http://www.redis.cn/download.html 安装的前提条件: 需要安装gcc:yum install gcc-c++ wget http://download ...