﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-Robert' Game Programming-文章分类-零散知识</title><link>http://www.cppblog.com/roberthu/category/13882.html</link><description /><language>zh-cn</language><lastBuildDate>Sun, 23 May 2010 12:29:40 GMT</lastBuildDate><pubDate>Sun, 23 May 2010 12:29:40 GMT</pubDate><ttl>60</ttl><item><title>内存对齐</title><link>http://www.cppblog.com/roberthu/articles/116175.html</link><dc:creator>Robert.Hu</dc:creator><author>Robert.Hu</author><pubDate>Sun, 23 May 2010 08:59:00 GMT</pubDate><guid>http://www.cppblog.com/roberthu/articles/116175.html</guid><wfw:comment>http://www.cppblog.com/roberthu/comments/116175.html</wfw:comment><comments>http://www.cppblog.com/roberthu/articles/116175.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/roberthu/comments/commentRss/116175.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/roberthu/services/trackbacks/116175.html</trackback:ping><description><![CDATA[占个楼先<img src ="http://www.cppblog.com/roberthu/aggbug/116175.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/roberthu/" target="_blank">Robert.Hu</a> 2010-05-23 16:59 <a href="http://www.cppblog.com/roberthu/articles/116175.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Unicode Ansi Utf-8 编码方式 </title><link>http://www.cppblog.com/roberthu/articles/116173.html</link><dc:creator>Robert.Hu</dc:creator><author>Robert.Hu</author><pubDate>Sun, 23 May 2010 08:57:00 GMT</pubDate><guid>http://www.cppblog.com/roberthu/articles/116173.html</guid><wfw:comment>http://www.cppblog.com/roberthu/comments/116173.html</wfw:comment><comments>http://www.cppblog.com/roberthu/articles/116173.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/roberthu/comments/commentRss/116173.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/roberthu/services/trackbacks/116173.html</trackback:ping><description><![CDATA[


<span class="Apple-tab-span" style="white-space:pre">	</span>工作中碰到这些问题，不太了解，问了一下，被BS了，今天看了些资料，大致总结如下：<div><strong>Unicode:</strong> 用二个字节表示世界各国语言的字符，中文当然也包括在内，占两个字节，英文也一律占两上字节。所以用Unicode保存英文可能会比较浪费空间。由于Unicode占两个字节，比如一个汉字用unicode表示为<span style="font-family: 宋体; font-size: 14px; line-height: 20px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">594E，这个时候，就有字节序的问题了，到底是用big Ending写成594E呢，还是用little Ending写成4E59呢？</span></div><div><strong>UTF-8:</strong> 也是国际通用的一种表示方法，它的单位是一个字节</div><div><span style="font-family: 宋体; font-size: 14px; line-height: 20px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">0000 - 007F 0xxxxxxx<span class="Apple-tab-span" style="white-space:pre">				</span>用一个字节就可以表示的字符</span></div><div><span style="font-family: 宋体; font-size: 14px; line-height: 20px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><span class="Apple-tab-span" style="white-space:pre"><span style="white-space: normal; ">0080 - 07FF 110xxxxx 10xxxxxx&nbsp;<span class="Apple-tab-span" style="white-space:pre">			</span>用二个字节保存的字符<br>0800 - FFFF 1110xxxx 10xxxxxx 10xxxxxx<span class="Apple-tab-span" style="white-space:pre">		</span>需要用三个字节保存的字符</span></span></span></div><div><font face="宋体" size="4"><span style="font-size: 14px; line-height: 20px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">当读这些二进制流的时候，就容易辩认出它所代表的字符。汉字是用三个字节来保存。</span></font></div><div><font face="宋体" size="4"><span style="font-size: 14px; line-height: 20px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><strong>ANSI和GBK</strong>: ANSI英文用一个字节表示，中文的话用二个字节表示,</span></font><span style="font-family: Arial; font-size: 14px; line-height: 22px; white-space: pre-wrap; ">区分中文编码的方法是高字节的最高位不为0。</span></div><div><span style="font-family: Arial; font-size: 14px; line-height: 22px; white-space: pre-wrap; "><span style="font-family: arial; line-height: 24px; white-space: normal; ">不同的国家和地区制定了不同的标准，由此产生了 GB2312, BIG5, JIS 等各自的编码标准。这些使用 2 个字节来代表一个字符的各种汉字延伸编码方式，称为 ANSI 编码。在简体中文系统下，ANSI 编码代表 GB2312 编码，在日文操作系统下，ANSI 编码代表 JIS 编码</span></span></div><img src ="http://www.cppblog.com/roberthu/aggbug/116173.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/roberthu/" target="_blank">Robert.Hu</a> 2010-05-23 16:57 <a href="http://www.cppblog.com/roberthu/articles/116173.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>