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 6362(求椭圆中矩形周长的期望 数学)
题意是给定一个椭圆标准方程的a,b(椭圆的长半轴长和短半轴长),在[0,b]内取一个数,则过点(0,b)且平行于x轴的直线与椭圆交于两点,再将此两点关于x轴做对称点,顺次连接此四点构成矩形,求出这些矩 ...
- c++后台开发路线
- 《区块链生存训练2.0》PDF
<区块链生存训练>2.0于2018年2月28日在我的知识星球里发布.时过1年多,很多内容又过时了,准备修改新的版本,现在把PDF公布出来. 下载地址: 链接: https://pan.ba ...
- 细说shiro之四:在web应用中使用shiro
官网:https://shiro.apache.org/ 1. 下载在Maven项目中的依赖配置如下: <!-- shiro配置 --> <dependency> <gr ...
- 【转载】C# 字符串截取
https://blog.csdn.net/maba007/article/details/78424760
- 【十二】jvm 性能调优工具之 jhat (JVM Heap Analysis Tool)
jhat也是jdk内置的工具之一.主要是用来分析java堆的命令,可以将堆中的对象以html的形式显示出来,包括对象的数量,大小等等,并支持对象查询语言. jhat 非常耗费cpu和内存,所以一般不使 ...
- 一、linux 内核介绍
参考文档: linux 内核剖析:https://www.ibm.com/developerworks/cn/linux/l-linux-kernel/ 1.1 linux 内核历史 在 20 世纪 ...
- 【bzoj 4756】[Usaco2017 Jan] Promotion Counting
Description The cows have once again tried to form a startup company, failing to remember from past ...
- DNN-HMM
<<DNN-HMM.docx>>
- linux 僵屍进程
参考链接 : http://soft.chinabyte.com/os/5/12172005.shtml