<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[阿Tim日志]]></title> 
<link>https://atim.cn/index.php</link> 
<description><![CDATA[专业的php开发者.开发团队的带队人]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[阿Tim日志]]></copyright>
<item>
<link>https://atim.cn/post/174/</link>
<title><![CDATA[判断字符串编码的函数及编码的理解]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[开发应用]]></category>
<pubDate>Tue, 13 Feb 2007 05:34:48 +0000</pubDate> 
<guid>https://atim.cn/post/174/</guid> 
<description>
<![CDATA[ 
	<div class="code"><br/>&lt;?<br/>function is_utf8($string) &#123;<br/>&nbsp;&nbsp; // From http://w3.org/International/questions/qa-forms-utf-8.html<br/>&nbsp;&nbsp; return preg_match(&#039;%^(?:<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#91;&#92;x09&#92;x0A&#92;x0D&#92;x20-&#92;x7E&#93;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# ASCII<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124; &#91;&#92;xC2-&#92;xDF&#93;&#91;&#92;x80-&#92;xBF&#93;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# non-overlong 2-byte<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124;&nbsp;&nbsp;&#92;xE0&#91;&#92;xA0-&#92;xBF&#93;&#91;&#92;x80-&#92;xBF&#93;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# excluding overlongs<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124; &#91;&#92;xE1-&#92;xEC&#92;xEE&#92;xEF&#93;&#91;&#92;x80-&#92;xBF&#93;&nbsp;&nbsp;# straight 3-byte<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124;&nbsp;&nbsp;&#92;xED&#91;&#92;x80-&#92;x9F&#93;&#91;&#92;x80-&#92;xBF&#93;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# excluding surrogates<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124;&nbsp;&nbsp;&#92;xF0&#91;&#92;x90-&#92;xBF&#93;&#91;&#92;x80-&#92;xBF&#93;&nbsp;&nbsp;&nbsp;&nbsp;# planes 1-3<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124; &#91;&#92;xF1-&#92;xF3&#93;&#91;&#92;x80-&#92;xBF&#93;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# planes 4-15<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124;&nbsp;&nbsp;&#92;xF4&#91;&#92;x80-&#92;x8F&#93;&#91;&#92;x80-&#92;xBF&#93;&nbsp;&nbsp;&nbsp;&nbsp;# plane 16<br/>&nbsp;&nbsp; )*$%xs&#039;, $string);&nbsp;&nbsp;<br/>&#125;?&gt;<br/></div><br/>但不知道每一个国家的语言是怎样分别的?<br/>中文常用编码方式<br/><table width="400" border="1"><tr><td>ASCII</td><td>#最原的编码方式,计算机最初设计时用使用的编码</td><td>0-255</td></tr><tr><td>gb2313</td><td>#为了适应中文的应用,所制作出来的,使用用两个字节的表示</td><td>第一字节:176-247<br />第二字节:160-254</td></tr><tr>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<td>gbk</td><td>在gd2312的基础上扩容，而且为了统一中文字符用有又字节的都是从129开始</td><td>第一字节:129-254<br />第二字节:64-254</td></tr><tr><td>GB18030</td><td>在gbk的基础上扩容，而且而且增加了四字节显示</td><td>双字节部分:第一字节:176-254<br />第二字节:64-126,128-254<br />四字节部分:第一字节:176-254<br />第二字节:48-57<br />第三字节:176-254<br />第四字节:48-57</td></tr></table><br/>GB18030虽然为国标，但系一般情况使用比较小．<br/>多数使用GBK<br/>但是国际上为了更好的支持各国语言，开始了新的标准<br/><strong>Unicode</strong><br/>国际标准组织于1984年4月成立ISO/IECJTC1/SC2/WG2工作组，针对各国文字、符号进行统一性编码。1991年美国跨国公司成立UnicodeConsortium，并于1991年10月与WG2达成协议，采用同一编码字集。目前Unicode是采用16位编码体系，其字符集内容与ISO10646的BMP（BasicMultilingualPlane）相同。Unicode于1992年6月通过DIS（DrafInternationalStandard），目前版本V2.0于1996公布，内容包含符号6811个，汉字20902个，韩文拼音11172个，造字区6400个，保留20249个，共计65534个。<br/><img src="attachment/1171354785_0.gif" /><br/>即0x3400-0x4dB5<br/>及0x4E00-9FA5<br/>为中文编码<br/><br/>总结：<br/>无论ASCII,gb2312,GBK,GB18030,Unicode等都系编码方案<br/>在网络上传送的数据还是0000 0000<br/><br/><br/><br/>Tags - <a href="https://atim.cn/tags/%25E6%2595%25B0%25E6%258D%25AE/" rel="tag">数据</a> , <a href="https://atim.cn/tags/%25E7%25BC%2596%25E7%25A0%2581/" rel="tag">编码</a> , <a href="https://atim.cn/tags/%25E4%25BB%25A3%25E7%25A0%2581/" rel="tag">代码</a>
]]>
</description>
</item><item>
<link>https://atim.cn/post/174/#blogcomment85</link>
<title><![CDATA[[评论] 判断字符串编码的函数及编码的理解]]></title> 
<author>lee &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 13 Feb 2007 08:14:38 +0000</pubDate> 
<guid>https://atim.cn/post/174/#blogcomment85</guid> 
<description>
<![CDATA[ 
	这个帖子好火啊<br/>http://www.cnblogs.com/freeliver54/archive/2007/02/12/648209.aspx
]]>
</description>
</item><item>
<link>https://atim.cn/post/174/#blogcomment86</link>
<title><![CDATA[[评论] 判断字符串编码的函数及编码的理解]]></title> 
<author>小生 &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 13 Feb 2007 12:10:53 +0000</pubDate> 
<guid>https://atim.cn/post/174/#blogcomment86</guid> 
<description>
<![CDATA[ 
	哗~~~<br/>真是好多回复，而且每个回复都写佐好多字
]]>
</description>
</item><item>
<link>https://atim.cn/post/174/#blogcomment88</link>
<title><![CDATA[[评论] 判断字符串编码的函数及编码的理解]]></title> 
<author>lee &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 14 Feb 2007 01:19:16 +0000</pubDate> 
<guid>https://atim.cn/post/174/#blogcomment88</guid> 
<description>
<![CDATA[ 
	是啊,博客园都是.net程序员啊
]]>
</description>
</item><item>
<link>https://atim.cn/post/174/#blogcomment89</link>
<title><![CDATA[[评论] 判断字符串编码的函数及编码的理解]]></title> 
<author>小生 &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 14 Feb 2007 05:17:22 +0000</pubDate> 
<guid>https://atim.cn/post/174/#blogcomment89</guid> 
<description>
<![CDATA[ 
	看来.net程序员都是挺无聊的
]]>
</description>
</item>
</channel>
</rss>