> 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. React 手稿 - Component state

    Component state 实例: import React, { PureComponent } from 'react'; export default class extends PureC ...

  2. WCF与各语言通信框架比较

  3. HDU 4352

    #include <iostream> #include <cstdio> #include <cmath> #include <string.h> # ...

  4. pl/sql输入括号后卡顿的解决方式

    pl/sql输入括号后卡顿的解决方式 学习了:https://zhidao.baidu.com/question/298275368.html 工具->首选项->用户界面->代码助手 ...

  5. BEGINNING SHAREPOINT&#174; 2013 DEVELOPMENT 第3章节--SharePoint 2013 开发者工具 用SPD开发SharePoint应用程序

    BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第3章节--SharePoint 2013 开发者工具 用SPD开发SharePoint应用程序         非常多开 ...

  6. android Service中多线程交互

    android 的service和activity是执行在UI主线程的. 在android线程中,仅仅有主线程即UI线程有自己的默认的消息队列.子线程须要创建自己的消息队列.并把消息发给队列,并循环起 ...

  7. [C++设计模式] strategy 策略模式

    依照陈硕老师的观点.c++里有面向过程编程.面向对象编程,基于对象编程(面向接口编程)和泛型编程.四种思路都各有其适用场景. 面向过程编程是沿袭C的结构化编程思路,OOP是C++的核心,也是现代高级编 ...

  8. Directx Matrix.PerspectiveFovLH Matrix.PerspectiveFovRH的理解

    该函数一个四个参数public static Matrix PerspectiveFovLH ( float fieldOfViewY, float aspectRatio, float znearP ...

  9. 使用神经网络-垃圾邮件检测-LSTM或者CNN(一维卷积)效果都不错【代码有问题,pass】

    from sklearn.feature_extraction.text import CountVectorizer import os from sklearn.naive_bayes impor ...

  10. LightOJ--1094-- Farthest Nodes in a Tree(树的直径裸题)

    Farthest Nodes in a Tree Time Limit: 2000MS Memory Limit: 32768KB 64bit IO Format: %lld & %llu S ...