> 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. 在wamp中直接进入项目

    这个问题困扰了我很久, 暂时我解决了一半. 进入localhost的页面如图一: 可以看到 我有两个projects,但是点击后会直接转跳到这样的页面 例如点击phyfitness_proj,如图二所 ...

  2. Python 使用matplotlib模块模拟掷骰子

    掷骰子 骰子类 # die.py 骰子类模块 from random import randint class Die(): """骰子类""&quo ...

  3. 使用动态代理实现dao接口

    使用动态代理实现dao接口的实现类 MyBatis允许只声明一个dao接口,而无需写dao实现类的方式实现数据库操作.前提是必须保证Mapper文件中的<mapper>标签的namespa ...

  4. POJ 3709

    简单的单调队列优化,注意是哪些点加入队列即可. #include <iostream> #include <cstdio> #include <algorithm> ...

  5. IntelliJ IDEA 对于generated source的处理

    IntelliJ IDEA 对于generated source的处理 学习了:https://stackoverflow.com/questions/5170620/unable-to-use-in ...

  6. android 分享到QQ空间的全部操作

    http://wiki.open.qq.com/wiki/mobile/SDK下载   <!-- QZone分享必须加上以下两个activity -->                &l ...

  7. DesignPattern_Java:Factory Method Pattern

    工厂方法模式 Factory Method :(虚拟构造函数模式 Virtual Constructor,多态性工厂模式 Ploymorphic Facoty) Define an interface ...

  8. JS冒泡和闭包案例分析

    背景: 今天逛网页发现了百度知道上一个有意思的JS问题,提问者的问题事实上蛮简单的,懂点前端开发技术的应该都能实现.提问者的要求:实现子菜单的弹出,菜单共同拥有三级.每级菜单显示时有500毫秒的延迟. ...

  9. 数据结构(Java语言)——LinkedList简单实现

    下面是一个能够使用的LinkedList泛型类的实现.这里的链表类名为MyLinkedList,避免与类库中反复. MyLinkedList将作为双链表实现,并且保留到该表两端的引用.这样仅仅要操作发 ...

  10. COCOS2D-X 动作 CCSequence动作序列

    CCSequence继承于CCActionInterval类,CCActionInterval类为延时动作类,即动作在运行过程中有一个过程. CCSequence中的重要方法: static CCSe ...