﻿<?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>博客园-Wind-Eagle-最新评论</title><link>http://www.cnblogs.com/Wind-Eagle/CommentsRSS.aspx</link><description>No pain,no gain!</description><language>zh-cn</language><pubDate>Mon, 12 Apr 2010 03:30:16 GMT</pubDate><lastBuildDate>Mon, 12 Apr 2010 03:30:16 GMT</lastBuildDate><generator>cnblogs</generator><item><title>Re:用C#创建一个封装Google Map API的GoogleMap Web服务器控件(二)</title><link>http://www.cnblogs.com/Wind-Eagle/archive/2010/05/21/1167663.html#1829881</link><dc:creator>shp_yt</dc:creator><author>shp_yt</author><pubDate>Fri, 21 May 2010 08:19:18 GMT</pubDate><guid>http://www.cnblogs.com/Wind-Eagle/archive/2010/05/21/1167663.html#1829881</guid><description><![CDATA[封装的非常好，GoogleInfoWindow,GoogleMarker类及相应的集合类,并给GoogleMap类添加相应的集合属性及其他属性 我在你的博客中没有找到.能否发份给我，谢谢。shp_yt@163.com<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/Wind-Eagle/" target="_blank">shp_yt</a> 2010-05-21 16:19 <a href="http://www.cnblogs.com/Wind-Eagle/archive/2010/05/21/1167663.html#1829881#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:UTF-8, Unicode, GB2312三种编码方式解析, 深入研究汉字编码</title><link>http://www.cnblogs.com/Wind-Eagle/archive/2010/04/12/1710062.html#1799846</link><dc:creator>缤纷</dc:creator><author>缤纷</author><pubDate>Mon, 12 Apr 2010 14:49:34 GMT</pubDate><guid>http://www.cnblogs.com/Wind-Eagle/archive/2010/04/12/1710062.html#1799846</guid><description><![CDATA[好东西，收藏了<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/Wind-Eagle/" target="_blank">缤纷</a> 2010-04-12 22:49 <a href="http://www.cnblogs.com/Wind-Eagle/archive/2010/04/12/1710062.html#1799846#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:C#中判断字符是否为中文</title><link>http://www.cnblogs.com/Wind-Eagle/archive/2010/04/09/1182336.html#1797583</link><dc:creator>Andrew Yin</dc:creator><author>Andrew Yin</author><pubDate>Fri, 09 Apr 2010 10:25:01 GMT</pubDate><guid>http://www.cnblogs.com/Wind-Eagle/archive/2010/04/09/1182336.html#1797583</guid><description><![CDATA[        public static int ChineseLetterCode(string input, int index)
        {
            var chfrom = Convert.ToInt32(&quot;4e00&quot;, 16); //范围（0x4e00～0x9fff）转换成int（chfrom～chend）
            var chend = Convert.ToInt32(&quot;9fa5&quot;, 16);
            if (input != &quot;&quot;)
            {
                var code = Char.ConvertToUtf32(input, index);

                return code &gt;= chfrom &amp;&amp; code &lt;= chend ? code : 0;
            }
            return 0;
        }

        public static string ChineseLetterHexCode(string input, int index)
        {
            var code = ChineseLetterCode(input, index);
            return code != 0 ? code.ToString(&quot;X4&quot;) : string.Empty;
        }

        public static string ChineseLetterFromCode(int code)
        {
            var chfrom = Convert.ToInt32(&quot;4e00&quot;, 16); //范围（0x4e00～0x9fff）转换成int（chfrom～chend）
            var chend = Convert.ToInt32(&quot;9fa5&quot;, 16);
            //return code &gt;= chfrom &amp;&amp; code &lt;= chend ? Char.ConvertFromUtf32(code) : string.Empty;
            if (code &gt;= chfrom &amp;&amp; code &lt;= chend)
            {
                var gb = System.Text.Encoding.GetEncoding(&quot;Unicode&quot;);
                var b = new[] {(byte) (code%0x100), (byte) (code/0x100)};
                return gb.GetString(b);
            }
            return string.Empty;
        }

        public static string ChineseLetterFromHexCode(string hexCode)
        {
            var code = int.Parse(hexCode, NumberStyles.HexNumber);
            return ChineseLetterFromCode(code);
        }
    }
}<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/Wind-Eagle/" target="_blank">Andrew Yin</a> 2010-04-09 18:25 <a href="http://www.cnblogs.com/Wind-Eagle/archive/2010/04/09/1182336.html#1797583#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:C#中判断字符是否为中文</title><link>http://www.cnblogs.com/Wind-Eagle/archive/2010/04/09/1182336.html#1797582</link><dc:creator>Andrew Yin</dc:creator><author>Andrew Yin</author><pubDate>Fri, 09 Apr 2010 10:24:48 GMT</pubDate><guid>http://www.cnblogs.com/Wind-Eagle/archive/2010/04/09/1182336.html#1797582</guid><description><![CDATA[using System;
using System.Collections.Generic;
using System.Globalization;

namespace Encoding
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var gb = System.Text.Encoding.GetEncoding(&quot;Unicode&quot;);
            Console.WriteLine(gb.GetBytes(&quot;草&quot;));

            gb = System.Text.Encoding.GetEncoding(&quot;UTF-8&quot;);
            Console.WriteLine(gb.GetBytes(&quot;草&quot;));

            gb = System.Text.Encoding.GetEncoding(&quot;GB2312&quot;);
            Console.WriteLine(gb.GetBytes(&quot;啊&quot;));

            Console.WriteLine(System.Text.Encoding.GetEncoding(&quot;Unicode&quot;).GetString(
                Utf8_2_Unicode(System.Text.Encoding.GetEncoding(&quot;UTF-8&quot;).GetBytes(&quot;草xdvsd泥56765@@@@@@@)^%&amp;^%&amp;^$#@#!#$马&quot;))));

            Console.WriteLine(IsChineseLetter(&quot;草泥马&quot;, 0));
            Console.WriteLine(ChineseLetterCode(&quot;草泥马&quot;, 0));
            Console.WriteLine(ChineseLetterFromCode(ChineseLetterCode(&quot;草泥马&quot;, 0)));

            //http://qkzz.net/article/3d697483-a5ae-4b50-9ae9-45dc6dd26141.htm
            //http://topic.csdn.net/u/20090617/18/1907627e-ce38-4ae5-9755-1cc349a4ed1a.html
            for (byte i = 0xb0; i &lt; 0xff; i++)
            {
                for (byte j = 0xa1; j &lt; 0xfe; j++)
                {
                    Console.Write(gb.GetString(new[] {i, j}));
                }
            }

            for (var i = 19968; i &lt;= 40959; i++)
            {
                Console.Write(ChineseLetterFromCode(i));
            }
            Console.Read();
        }

        /// &lt;summary&gt;
        /// UTF8 汉字字节流转成 Unicode 汉字字节流
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;input&quot;&gt;&lt;/param&gt;
        /// &lt;see cref=&quot;http://hi.baidu.com/hyqsoft/blog/item/263795a164d1728346106464.html&quot;/&gt;
        public static byte[] Utf8_2_Unicode(byte[] input)
        {
            //Array.Reverse(input);
            var ret = new List&lt;byte&gt;();
            for (var i = 0; i &lt; input.Length; i++)
            {
                if (input[i] &gt;= 240) // &quot;11110111&quot;
                {
// ReSharper disable RedundantAssignment
                    i += 3;
// ReSharper restore RedundantAssignment
                    throw new Exception(&quot;四字节的 UTF-8 字符不能转换成两字节的 Unicode 字符！&quot;);
                }
// ReSharper disable RedundantIfElseBlock
                else if (input[i] &gt;= 224)
// ReSharper restore RedundantIfElseBlock
                {
                    ret.Add((byte) ((input[i + 2] &amp; 63) | ((input[i + 1] &amp; 3) &lt;&lt; 6)));
                    ret.Add((byte) ((input[i] &lt;&lt; 4) | ((input[i + 1] &amp; 60) &gt;&gt; 2)));
                    i += 2;
                }
                else if (input[i] &gt;= 192)
                {
                    ret.Add((byte) ((input[i + 1] &amp; 63) | ((input[i] &amp; 3) &lt;&lt; 6)));
                    ret.Add((byte) ((input[i] &amp; 28) &gt;&gt; 2));
                    i += 1;
                }
                else
                {
                    ret.Add(input[i]);
                    ret.Add(0);
                }
            }
            return ret.ToArray();
        }

        public static bool IsChineseLetter(string input, int index)
        {
            var chfrom = Convert.ToInt32(&quot;4e00&quot;, 16); //范围（0x4e00～0x9fff）转换成int（chfrom～chend）
            var chend = Convert.ToInt32(&quot;9fa5&quot;, 16);
            if (input != &quot;&quot;)
            {
                //var code = Char.ConvertToUtf32(input, index);
                var gb = System.Text.Encoding.GetEncoding(&quot;Unicode&quot;);
                var b = gb.GetBytes(input.Substring(index, 1));
                var code = b[0] + b[1]*0x100;

                return code &gt;= chfrom &amp;&amp; code &lt;= chend;
            }
            return false;
        }
<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/Wind-Eagle/" target="_blank">Andrew Yin</a> 2010-04-09 18:24 <a href="http://www.cnblogs.com/Wind-Eagle/archive/2010/04/09/1182336.html#1797582#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:用C#创建一个封装Google Map API的GoogleMap Web服务器控件(二)</title><link>http://www.cnblogs.com/Wind-Eagle/archive/2010/02/09/1167663.html#1763589</link><dc:creator>Nestcn</dc:creator><author>Nestcn</author><pubDate>Tue, 09 Feb 2010 08:50:36 GMT</pubDate><guid>http://www.cnblogs.com/Wind-Eagle/archive/2010/02/09/1167663.html#1763589</guid><description><![CDATA[Google Map控件封装的不错，学习了，一直关注您的博客！
[url=http://www.nestcn.com]http://www.nestcn.com[/url]<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/Wind-Eagle/" target="_blank">Nestcn</a> 2010-02-09 16:50 <a href="http://www.cnblogs.com/Wind-Eagle/archive/2010/02/09/1167663.html#1763589#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:ASP.NET MVC中的各种上下文对象</title><link>http://www.cnblogs.com/Wind-Eagle/archive/2009/12/07/1348263.html#1716714</link><dc:creator>幸运猴子</dc:creator><author>幸运猴子</author><pubDate>Mon, 07 Dec 2009 08:46:59 GMT</pubDate><guid>http://www.cnblogs.com/Wind-Eagle/archive/2009/12/07/1348263.html#1716714</guid><description><![CDATA[非常不错，<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/Wind-Eagle/" target="_blank">幸运猴子</a> 2009-12-07 16:46 <a href="http://www.cnblogs.com/Wind-Eagle/archive/2009/12/07/1348263.html#1716714#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:System.Web.Routing命名空间代码解析（三） RouteCollection类</title><link>http://www.cnblogs.com/Wind-Eagle/archive/2009/11/02/1348528.html#1688025</link><dc:creator>ERic Poon</dc:creator><author>ERic Poon</author><pubDate>Mon, 02 Nov 2009 08:32:45 GMT</pubDate><guid>http://www.cnblogs.com/Wind-Eagle/archive/2009/11/02/1348528.html#1688025</guid><description><![CDATA[用IDisposable来做锁，易锁易解。
比以往使用lock( new object())要好。<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/Wind-Eagle/" target="_blank">ERic Poon</a> 2009-11-02 16:32 <a href="http://www.cnblogs.com/Wind-Eagle/archive/2009/11/02/1348528.html#1688025#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:.NET下的AOP： PostSharp 原理分析</title><link>http://www.cnblogs.com/Wind-Eagle/archive/2009/11/02/1351746.html#1688009</link><dc:creator>ERic Poon</dc:creator><author>ERic Poon</author><pubDate>Mon, 02 Nov 2009 08:22:39 GMT</pubDate><guid>http://www.cnblogs.com/Wind-Eagle/archive/2009/11/02/1351746.html#1688009</guid><description><![CDATA[对文中提到“对程序集”的了解很有兴趣，我们该怎么理解。
谢谢！<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/Wind-Eagle/" target="_blank">ERic Poon</a> 2009-11-02 16:22 <a href="http://www.cnblogs.com/Wind-Eagle/archive/2009/11/02/1351746.html#1688009#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:用C#创建一个封装Google Map API的GoogleMap Web服务器控件(一)</title><link>http://www.cnblogs.com/Wind-Eagle/archive/2009/10/22/1167202.html#1678324</link><dc:creator>zhangjc</dc:creator><author>zhangjc</author><pubDate>Thu, 22 Oct 2009 03:20:55 GMT</pubDate><guid>http://www.cnblogs.com/Wind-Eagle/archive/2009/10/22/1167202.html#1678324</guid><description><![CDATA[不错,能把源码发过来.zjc8282000@126.com<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/Wind-Eagle/" target="_blank">zhangjc</a> 2009-10-22 11:20 <a href="http://www.cnblogs.com/Wind-Eagle/archive/2009/10/22/1167202.html#1678324#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Re:用C#创建一个封装Google Map API的GoogleMap Web服务器控件(一)</title><link>http://www.cnblogs.com/Wind-Eagle/archive/2009/09/22/1167202.html#1654742</link><dc:creator>zhangqs</dc:creator><author>zhangqs</author><pubDate>Tue, 22 Sep 2009 09:10:51 GMT</pubDate><guid>http://www.cnblogs.com/Wind-Eagle/archive/2009/09/22/1167202.html#1654742</guid><description><![CDATA[能把源码发给我一下吗？谢谢！我的邮箱：zhangqs008@163.com<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/Wind-Eagle/" target="_blank">zhangqs</a> 2009-09-22 17:10 <a href="http://www.cnblogs.com/Wind-Eagle/archive/2009/09/22/1167202.html#1654742#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>
