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 ...
随机推荐
- springBoot整合多数据源
springBoot整合相关 1:springBoot整合多数据源: 应用场景: 项目需要同时连接两个不同的数据库A, B,并且它们都为主从架构,一台写库,多台读库. 工具/版本: jdk1. ...
- Silverlight界面设计
d:DesignHeight="300" d:DesignWidth="400"> 并不会限定Grid的大小,最终的效果,还要根据Grid的大小,Grid ...
- Spring Boot 起步
……………………………………………………………………………………………………………… [应用配置]application.yml [port][context-path][datasource][jp ...
- css控制继承
inherit:继承父类. initial:继承浏览器. unset:重置为自然值,继承父类或者浏览器. revert:恢复原来的值. 详解: CSS为处理继承提供了四种特殊的通用属性值: inher ...
- namecheap域名设置Cloudflare为第三方DNS
待更……等我搞完了就来写总结
- ansible学习笔记一
ansible学习笔记一 参考博客: ansible学习 - 51CTO博客 一.安装 1 .下载epel源 wget -O /etc/yum.repos.d/epel.repo http://mir ...
- CF 1060E. Sergey and Subway
题目链接 题意:给你一棵树,然后连接两个有公共邻居的点,问你连完后,任意两点的距离之和. 一开始看这种题,还不怎么会做,借鉴了这位大佬的博客,get到了新技能,当我们求树上任意俩点的距离之时,可以转化 ...
- webpack中resolve用法
如果想在页面中使用 bootstrap 的样式,一般会在入口文件中引入 import 'bootstrap' 但是这样引入的 bootstrap 默认引入的是JS文件,所以页面的样式是不会生效的,下面 ...
- 【转载】java abstract class和interface的区别
转载:https://blog.csdn.net/b271737818/article/details/3950245 在Java语言中,abstract class和interface是支持抽象类定 ...
- BootstrapValidator 解决多属性被同时校验问题
问题描述:在使用bootstrapValidator插件校验表单属性,当表单属性过多需要每行并列多个属性 ,会出现校验第一个属性,发现整行被校验的效果 ,这不是我们工作想要的效果.如图: 问题分析:因 ...