<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>中文Flex例子 &#187; 编码</title>
	<atom:link href="http://blog.minidx.com/tag/%e7%bc%96%e7%a0%81/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.minidx.com</link>
	<description>中文Adobe Flex例子,Flex实例教程,RIA资源,全文检索技术,算法和数据结构</description>
	<lastBuildDate>Thu, 31 Mar 2011 03:22:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>GBK,BIG5等字符集编码范围的具体说明</title>
		<link>http://blog.minidx.com/2008/12/06/1689.html</link>
		<comments>http://blog.minidx.com/2008/12/06/1689.html#comments</comments>
		<pubDate>Sat, 06 Dec 2008 10:00:33 +0000</pubDate>
		<dc:creator>Minidxer</dc:creator>
				<category><![CDATA[搜索引擎]]></category>
		<category><![CDATA[程序开发相关]]></category>
		<category><![CDATA[BIG5]]></category>
		<category><![CDATA[GBK]]></category>
		<category><![CDATA[字符集]]></category>
		<category><![CDATA[编码]]></category>

		<guid isPermaLink="false">http://blog.minidx.com/?p=1689</guid>
		<description><![CDATA[通过前面的 关于计算机中Endian（big-edian和little-endian）存储机制的由来、特点和区别和一篇关于Unicode编码的UCS、UTF、BMP、BOM等概念的不错的文章 这两篇文章，读过之后应该对字符编码有一个比较深刻地了解，不过这个世界是有很多个说着不同语言的国家组成的，在追求国际化的同时，更多的是要求本土化，所以很多计算机软件系统应用的是本土的语言编码，而不是通用的UTF8等。各自的编码都有一定的范围，下面的文章对字符集和编码的概念，以及一些常用编码的范围进行了非常详细地说明，做相关方面工作的可要收藏了。








一 预备知识
1，字符：字符是抽象的最小文本单位。它没有固定的形状（可能是一个字形），而且没有值。“A”是一个字符，“€”（德国、法国和许多其他欧洲国家通用货币的标志）也是一个字符。“中”“国”这是两个汉字字符。字符仅仅代表一个符号，没有任何实际值的意义。
2，字符集：字符集是字符的集合。例如，汉字字符是中国人最先发明的字符，在中文、日文、韩文和越南文的书写中使用。这也说明了字符和字符集之间的关系，字符组成字符集（iso8859-1，GB2312/GBK，unicode）。
3，代码点：字符集中的每个字符都被分配到一个“代码点”。每个代码点都有一个特定的唯一数值，称为标值。该标量值通常用十六进制表示。
4，代码单元： 在每种编码形式中，代码点被映射到一个或多个代码单元。“代码单元”是各个编码方式中的单个单元。代码单元的大小等效于特定编码方式的位数：
UTF-8 ：UTF-8 中的代码单元由 8 位组成；在 UTF-8 中，因为代码单元较小的缘故，每个代码点常常被映射到多个代码单元。代码点将被映射到一个、两个、三个或四个代码单元；
UTF-16 ：UTF-16 中的代码单元由 16 位组成；UTF-16 的代码单元大小是 8 位代码单元的两倍。所以，标量值小于 U+10000 的代码点被编码到单个代码单元中；
UTF-32：UTF-32  中的代码单元由 32 位组成； UTF-32 中使用的 32 位代码单元足够大，每个代码点都可编码为单个代码单元；
GB18030：GB18030  中的代码单元由 8 位组成；在 GB18030 中，因为代码单元较小的缘故，每个代码点常常被映射到多个代码单元。代码点将被映射到一个、两个或四个代码单元。
5，举例：
“中国北京香蕉是个大笨蛋”这是我定义的aka字符集；各字符对应代码点为：
北 00000001
京 00000010
香 10000001
蕉 10000010
是 10000100
个 10001000
大 10010000
笨 10100000
蛋 11000000
中 00000100
国 00001000
下面是我定义的 zixia 编码方案（8位），可以看到它的编码中表示了aka字符集的所有字符对应的 代码单元；
北 10000001
京 10000010
香 00000001
蕉 00000010
是 00000100
个 00001000
大 00010000
笨 00100000
蛋 01000000
中 10000100
国 10001000
所谓文本文件 [...]]]></description>
		<wfw:commentRss>http://blog.minidx.com/2008/12/06/1689.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>将任意的非ASCII字符串进行HTML的URL编码</title>
		<link>http://blog.minidx.com/2008/02/28/520.html</link>
		<comments>http://blog.minidx.com/2008/02/28/520.html#comments</comments>
		<pubDate>Thu, 28 Feb 2008 15:02:30 +0000</pubDate>
		<dc:creator>Minidxer</dc:creator>
				<category><![CDATA[程序开发相关]]></category>
		<category><![CDATA[ASCII]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[URL]]></category>
		<category><![CDATA[字符串]]></category>
		<category><![CDATA[编码]]></category>

		<guid isPermaLink="false">http://blog.minidx.com/2008/02/28/520.html</guid>
		<description><![CDATA[在Java的HTML的URL字符编码转换为Java字符串的函数中，介绍了将HTML的字符串转换为Java中的字符串(String)的操作,相反的，我们也需要将一些字符串编码为HTML的形式，否则由某些字符组成的URL并不能将你带到期望的Page中去。下面是具体的代码，读懂它同样需要一定的计算机文字编码的功底，否则可能会看得一头雾水，纯粹使用的话那把下面URLUTF8Encoder类加到自己的工程中就可以正常使用了，:)








下面是具体的代码：
Download: URLUTF8Encoder.java/*** Provides a method to encode any string into a URL-safe* form.* Non-ASCII characters are first encoded as sequences of* two or three bytes, using the UTF-8 algorithm, before being* encoded as %HH escapes.*/public class URLUTF8Encoder{&#160;final static String[] hex = {&#34;%00&#34;, &#34;%01&#34;, &#34;%02&#34;, &#34;%03&#34;, &#34;%04&#34;, &#34;%05&#34;, &#34;%06&#34;, &#34;%07&#34;,&#34;%08&#34;, &#34;%09&#34;, &#34;%0a&#34;, &#34;%0b&#34;, &#34;%0c&#34;, &#34;%0d&#34;, &#34;%0e&#34;, [...]]]></description>
		<wfw:commentRss>http://blog.minidx.com/2008/02/28/520.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UTF8编码的中文词库下载</title>
		<link>http://blog.minidx.com/2007/12/12/241.html</link>
		<comments>http://blog.minidx.com/2007/12/12/241.html#comments</comments>
		<pubDate>Wed, 12 Dec 2007 14:49:48 +0000</pubDate>
		<dc:creator>Minidxer</dc:creator>
				<category><![CDATA[Minidx相关]]></category>
		<category><![CDATA[Minidx]]></category>
		<category><![CDATA[UTF8]]></category>
		<category><![CDATA[中文分词]]></category>
		<category><![CDATA[中文词库]]></category>
		<category><![CDATA[字典]]></category>
		<category><![CDATA[编码]]></category>

		<guid isPermaLink="false">http://blog.minidx.com/2007/12/12/241.html</guid>
		<description><![CDATA[其实这里提供的中文词库是是Sucirst转发给我的，“做任何搜索或者其他应用的词库都不是一个人能完成的，原来在和一些朋友讨论的时候得到了附件中的资料，是用于Lucene的中文UTF-8词库，也许对你也能有些帮助……”，Minidx目前拥有非常庞大的词库而没有使用这一词库，不过非常感谢Sucirst，呵呵，正如Sucirst所说的，也许有人需要，所以在这里传上来，在http://cn.minidx.com/index.php?option=com_docman&#38;task=cat_view&#38;gid=17 （相关文档资料中）下载
你可能还对下列文章感兴趣:自动链接CGI和HTML的Location功能GBK,BIG5等字符集编码范围的具体说明利用Minidx Extract-Text Com组件封装类的实现利用Minidx Extract-Text Com组件从doc,Xls,Pdf&#8230;&#8230;等读取文本内容VC2003 Demo将任意的非ASCII字符串进行HTML的URL编码]]></description>
		<wfw:commentRss>http://blog.minidx.com/2007/12/12/241.html/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>利用Packer对JavaScript进行加密（压缩），解密（解压）</title>
		<link>http://blog.minidx.com/2007/11/22/123.html</link>
		<comments>http://blog.minidx.com/2007/11/22/123.html#comments</comments>
		<pubDate>Thu, 22 Nov 2007 15:42:36 +0000</pubDate>
		<dc:creator>Minidxer</dc:creator>
				<category><![CDATA[Web/CGI相关]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Packer]]></category>
		<category><![CDATA[全局变量]]></category>
		<category><![CDATA[加密]]></category>
		<category><![CDATA[压缩]]></category>
		<category><![CDATA[局部变量]]></category>
		<category><![CDATA[编码]]></category>
		<category><![CDATA[解压]]></category>
		<category><![CDATA[解密]]></category>

		<guid isPermaLink="false">http://blog.minidx.com/2007/11/22/123.html</guid>
		<description><![CDATA[有人将Packer称为JavaScript的加密工具（混淆工具），也有人将其称为压缩工具。不管怎么说，Packer实质上是一个编码工具，不过经过它编码后可以被浏览器直接识别。使用也非常简单，在“Encoding”选项中，有四个项目可以选择：None:简单压缩，移除空格和注释，编码特殊字符
Numeric：所有的字符都被编码成数字
Normal  ：所有的字符都被编码成字母与数字符号构成的值。这是推荐的方式。
High ASCII：这种方式的压缩率较高。不推荐，会有兼容性








Fast Decode（快速还原）：该选项被选中的话，将插入一小段代码（120 bytes），以使代码能够更快的还原（decode）
Special Characters（特殊字符）：为了让压缩能区分全局变量和局部变量，压缩工具会将变量转换成下面的格式，由于 Javascript 并不存在确切意义上的全局变量和局部变量，我们可以用下面的方式定义：
局部变量 Local ($)
变量只在当前范围内有效，参数和函数内部的变量就是一个典型例子，将局部变量用 $ 标识，压缩时会截取他们的第一个字符，附加的 $ 将使截取的字符加长，数字将会被保留。
// unpacked:
function test($left, $top1, $top2, $$length) {
// do something
};
// packed:
function test(l,t1,t2,le){};
全局变量 Private (_)
全局变量可以在整个代码中使用，用 “ _ ” （下划线）来标识，有下划线标识的全局变量将会被转换成下划线加上一个数字：
// unpacked:
var _CONSTANT = 42;
function _test($left, $top1, $top2, $$length) {
return ($top1 / $top2) + _CONSTANT;
};
// packed:
var _0=42;function _1(l,t1,t2,le){return(t1/t2)+_0};
JavaScrip可以直接通过http://blog.minidx.com/ext/demo.html执行（我自己为了方便起见放的）。
最新版本可以访问：http://dean.edwards.name/packer/，还包括.NET, perl and PHP版本。
你可能还对下列文章感兴趣:DES加密标准的说明以及加密/解密函数的实现源代码15款手风琴(Accordion)效果的Ajax插件(推荐)100多个很有用的JavaScript函数以及基础写法大集合GBK,BIG5等字符集编码范围的具体说明Adobe AIR 1.5中如何使用SQLite加密功能的教程]]></description>
		<wfw:commentRss>http://blog.minidx.com/2007/11/22/123.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>自动链接CGI和HTML的Location功能</title>
		<link>http://blog.minidx.com/2007/11/02/44.html</link>
		<comments>http://blog.minidx.com/2007/11/02/44.html#comments</comments>
		<pubDate>Fri, 02 Nov 2007 10:07:48 +0000</pubDate>
		<dc:creator>Minidxer</dc:creator>
				<category><![CDATA[Web/CGI相关]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Location]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[refresh]]></category>
		<category><![CDATA[Status]]></category>
		<category><![CDATA[URL]]></category>
		<category><![CDATA[UTF8]]></category>
		<category><![CDATA[例子]]></category>
		<category><![CDATA[编码]]></category>
		<category><![CDATA[自动链接CGI]]></category>

		<guid isPermaLink="false">http://blog.minidx.com/?p=44</guid>
		<description><![CDATA[※作者：丁志刚 　转载请注明：Minidx全文检索【http://blog.minidx.com/2007/11/02/44.html】
■何谓“自动链接CGI”
所谓自动链接CGI，就是调用这个CGI的时候，可以转向致任意URL的CGI。应该有其他正式的名称，不过找了一下没有找到。
这里用httpd Head中的变量「Location」来实现。当然，HTML中还有同样功能的「refresh」，但是这样的话一旦转向到新的URL，点击浏览器的返回键好像很难返回。所以还是推荐使用「Location」。
简单的几个例子看看CGI中如何实现的吧。








■自动链接CGI的用法
方便起见，用Perl来举例，需要的人可以替换成任何其他语言。
#!/usr/local/bin/perl
#
# 自动链接CGI
# http://minidx.com
#
############################
print &#8220;Location: http://blog.minidx.com/\n\n&#8221;;
■进阶
通常我们可能需要指定页面的编码。我们以UTF8为例，再来看一个例子。
#!/usr/local/bin/perl
#
# 自动链接CGI指定编码例子
# http://minidx.com
#
######################################################
print &#8220;Status: 301 Mover Permanently\n&#8221;;
print &#8220;Content-Type: text/html; charset=UTF8\n&#8221;;
print &#8220;Location: http://blog.minidx.com/\n\n&#8221;;
这里的Status是Head中，改变CGI服务的状态的一个命令。上面的代码就是告诉服务器，改用UTF8编码的一个指示。
你可能还对下列文章感兴趣:将任意的非ASCII字符串进行HTML的URL编码Java的HTML的URL字符编码转换为Java字符串的函数UTF8编码的中文词库下载25篇非常详细的关于如何从PSD转换为HTML&#38;CSS的教程Flex中如何监测摄像头Camera对象活动以及状态事件与信息的例子]]></description>
		<wfw:commentRss>http://blog.minidx.com/2007/11/02/44.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 2/28 queries in 0.627 seconds using disk
Object Caching 447/848 objects using disk

Served from: blog.minidx.com @ 2012-02-10 01:03:25 -->
