> 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. 封装自己的jquery框架

    jQuery is a fast small JavaScript library 如何封装自己的jQuery <script> // 这里使用沙箱模式,可以防止全局污染 (functio ...

  2. [luogu3232 HNOI2013] 游走 (高斯消元 期望)

    传送门 题目描述 一个无向连通图,顶点从1编号到N,边从1编号到M. 小Z在该图上进行随机游走,初始时小Z在1号顶点,每一步小Z以相等的概率随机选 择当前顶点的某条边,沿着这条边走到下一个顶点,获得等 ...

  3. ExtJs之Ext.XTemplate:数组填充,访问父对象

    <!DOCTYPE html> <html> <head> <title>ExtJs</title> <meta http-equiv ...

  4. K - The Unique MST

    K - The Unique MST #include<iostream> #include<cstdio> #include<cstring> #include& ...

  5. gem update --system

    gem update --system 修改完gem sources之后,进行gem update: gem update --system 之后的输出: C:\Sites\test01>gem ...

  6. HDOJ 3339 In Action

    最短路+01背包 In Action Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Other ...

  7. 基于nginx的TCP Proxy实现数据库读写分离

    nginx非常早就支持tcp proxy.可是一直不知道其使用,近期在nginx blog上看见了.一些实践者将其运用到数据库訪问的负载均衡以及实现读写分离,来提高数据库的吞吐量,这里我不会讲详细的搭 ...

  8. 初识ecside

    ecside,基于jsp tag的开源列表组件.支持导出pdf.xsl.csv等文件. 主要标签<ec:table>\<ec:row>\<ec:column>. 支 ...

  9. $scope angular在controller之外调用

    1.定义 var m = angular.module('ddd',[]); m.controller('ctrl',['$scope',function ($scope) { }]); 2.外部调用 ...

  10. thinkPHP5 报错session_start(): No session id returned by function解决方法

    这是因为用Redis接管了session状态储存,但是Redis又连接不正常导致的 在服务器上查看Redis运行状态一切正常,set.get也没有问题,最后琢磨了半天才发现是PHPRedis扩展没有安 ...