encoding and Endian
Unicode, Code Point is the value of evry character in Unicode table(int,long,ll)
Unicode defines a codespace of 1,114,112 code points in the range 0hex to 10FFFFhex.
plane0(0000-FFFF), which is called Basic Multilingual Plane, contains most characters ,including Chinese
Code points in plane0 can be accessed as a single code unit in UTF-16, one to three bytes in UTF-8;
others are supplementary plane, accessed as surrogate pairs of UTF-16, four bytes in UTF-8
UTF-8, an 8-bit variable-width encoding which maximizes compatibility with ASCII;
UTF-16, a 16-bit, variable-width encoding;
UTF-32, a 32-bit, fixed-width encoding
stored in computer and endian:
characters can be encoded and then store the results in computer
a character with code point of 666, large than 0Xff, we usually use 1 bytes * 2 or 2 bytes * 1 to store the encoded value
we can read the value in C by:
char [] = "CharA" or wchar_t = 'CharA'
for a C executable, its memspace is like:
Mem---------MAX:0xfffffff--------------
kernel mem space------------
stack------------------bottom
|-----------
|-----------
|--------------top NULL------------------------
|
| Heap------------------------
Data------------------------
Code------------------------
Mem---------MIN0x00000000--------------- for example, an value is 0x123456,
Big-Endian: stack---------bottom little-Endian: stack---------bottom
|0x56 |0x12
|0x34 |0x34
|0x12 |0x56
|-----top |----top
int b =1;int *a = &b, char * p = (char*)a; if((p[] == 0x1) Big-Endian
Big-Endian, store the most significant byte in the smallest address
encoding and Endian的更多相关文章
- 基于五阶段流水线的RISC-V CPU模拟器实现
RISC-V是源自Berkeley的开源体系结构和指令集标准.这个模拟器实现的是RISC-V Specification 2.2中所规定RV64I指令集,基于标准的五阶段流水线,并且实现了分支预测模块 ...
- C# 字符编码类Encoding
在网络通信中,很多情况下都是将字符信息转成字节序列进行传输.将字符序列转为字节序列的过程称为编码.当这些字节传送到接收方,接收方需要逆向将字节序列转为字符序列.这个过程就是解码. 常见编码有ASCII ...
- unicode,ansi,utf-8,unicode big endian编码的区别
知乎--http://www.zhihu.com/question/23374078 http://wenku.baidu.com/view/cb9fe505cc17552707220865.html ...
- 关于Unicode和URL encoding入门的一切以及注意事项
本文同时也发表在我另一篇独立博客 <关于Unicode和URL encoding入门的一切以及注意事项>(管理员请注意!这两个都是我自己的原创博客!不要踢出首页!不是转载!已经误会三次了! ...
- C#中Encoding.Unicode与Encoding.UTF8的区别
今天在园子首页看到一篇博文-简单聊下Unicode和UTF-8,从中知道了UTF-8是Unicode的一种实现方式: Unicode只是给这世界上每个字符规定了一个统一的二进制编号,并没有规定程序该如 ...
- 字符集与字符编码 (charset & encoding)
乱码是个大坑,相信每个人都遇过,而且是个绕不过去的坑.我理解每个程序员都应该写一篇编码相关的博文,梳理自己对这一块的理解,下面是我反复理解多次之后的学习小结. 1.从记事本的不同编码说起: 打开记事本 ...
- 字符编码笔记:ASCII、Unicode、UTF-8、UTF-16、UCS、BOM、Endian
转载:http://witmax.cn/character-encoding-notes.html 今天中午,我突然想搞清楚Unicode和UTF-8之间的关系,于是就开始在网上查资料. 结果,这个问 ...
- 字符编码终极笔记:ASCII、Unicode、UTF-8、UTF-16、UCS、BOM、Endian
1.字符编码.内码,顺带介绍汉字编码 字符必须编码后才能被计算机处理.计算机使用的缺省编码方式就是计算机的内码.早期的计算机使用7位的ASCII编码,为了处理汉字,程序员设计了用于简体中文的GB231 ...
- .NETFramework:Encoding
ylbtech-.NETFramework:Encoding 1.返回顶部 1. #region 程序集 mscorlib, Version=4.0.0.0, Culture=neutral, Pub ...
随机推荐
- hdu 6385
题意是在一个矩形中任给N个点,求这N个点到矩形某边的最短距离和. 一开始想到直接贪心,求出每个点到矩形一边的最短距离,但题中说到线段间不能交叉,这里好像是比较麻烦,但题目中同时说了点与点之间的横纵坐标 ...
- Docker 从入门到放弃(三)镜像使用
当运行容器时,使用的镜像如果在本地中不存在,docker 就会自动从 docker 镜像仓库中下载,默认是从 Docker Hub 公共镜像源下载. 下面我们来学习: 1.管理和使用本地 Docker ...
- webservice 项目中遇到的问题
redshift database 连接异常 解决方案 url 修改添加参数如下 jdbc:redshift://hostname:5439/dbname?ssl=true&sslfactor ...
- 047、管理Docker Machine(2019-03012 周二)
参考https://www.cnblogs.com/CloudMan6/p/7248188.html 用docker-machine创建machine的过程很简洁,非常适合多主机环境.除此之外 ...
- JS 样式字符串 转 JSON对象
项目中需要把div 上的样式值转成数据展示 形如: padding: 7px 2px 1px 3px; color: rgb(238, 65, 65); background-color: rgb(2 ...
- EL11个内置对象
EL是JSP内置的表达式语言 JSP2.0开始,让再使用Java脚本,而是使用EL表达式和动态标签来代替Java脚本 EL替代的是<%=... %>,也就是说EL只能做输出 EL可以输出的 ...
- 【LeetCode】227. Basic Calculator
Problem: Implement a basic calculator to evaluate a simple expression string. The expression string ...
- Linux静默安装matlab
对linux系统不是很熟,所有装起来有点费劲.来来回回折腾了二三天,查了很多攻略,但按照步骤老是报错,大体上各人设备不同.系统不同.环境设置不同,总是会多多少少略有差异. 一 基本配置 linux系统 ...
- Java SE之正则表达式二:匹配
package demo.regex; import java.util.regex.Pattern; /* 正则表达式:匹配 */ public class RegexMatchesDemo { / ...
- AttributeError: module '__main__' has no attribute 'main'解决方法
在终端运行.py文件时报错:AttributeError: module '__main__' has no attribute 'main' 原因:在PyCharm里运行python程序需要添加 i ...