<?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>FalconIA&#039;s BLOG &#187; java</title>
	<atom:link href="https://falconia.org/blog/archives/tag/java/feed" rel="self" type="application/rss+xml" />
	<link>https://falconia.org/blog</link>
	<description>FalconIA&#039;s Lazy Blog</description>
	<lastBuildDate>Tue, 02 Dec 2014 01:45:41 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.38</generator>
	<item>
		<title>[转载]JAVA实现汉字转拼音缩写&#8211;类的静态方法</title>
		<link>https://falconia.org/blog/archives/197</link>
		<comments>https://falconia.org/blog/archives/197#comments</comments>
		<pubDate>Sat, 23 Apr 2011 23:39:44 +0000</pubDate>
		<dc:creator><![CDATA[FalconIA]]></dc:creator>
				<category><![CDATA[程序相关]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[编程]]></category>

		<guid isPermaLink="false">http://falconia.org/blog/?p=197</guid>
		<description><![CDATA[作　者：summerxzg 转载自：http://blog.csdn.net/summerxzg/archive/2009/05/06/4153961.aspx]]></description>
				<content:encoded><![CDATA[<p>作　者：summerxzg<br />
转载自：<a href="http://blog.csdn.net/summerxzg/archive/2009/05/06/4153961.aspx">http://blog.csdn.net/summerxzg/archive/2009/05/06/4153961.aspx</a></p>
<pre class="brush: java; title: ; notranslate">
public class aaaaaaa {
/**
     * 汉字转拼音缩写
     * @param str   //要转换的汉字字符串
     * @return String   //拼音缩写
     */
     public static String getPYString(String str)
     {
             String tempStr = &quot;&quot;;
             for(int i=0; i&lt;str.length(); i++) {
                     char c = str.charAt(i);
                     if((int)c &gt;= 33 &amp;&amp; (int)c &lt;=126) {//字母和符号原样保留
                             tempStr += String.valueOf(c);
                     }
                     else {//累加拼音声母
                             tempStr += getPYChar( String.valueOf(c) );
                     }
             }
             return tempStr;
     }
     /**
     * 取单个字符的拼音声母
     * @param c   //要转换的单个汉字
     * @return String 拼音声母
     */
     public static String getPYChar(String c)
     {
             byte[] array = new byte[2];
             array = String.valueOf(c).getBytes();
             int i = (short)(array[0] - '&#92;&#48;' + 256) * 256 + ((short)(array[1] - '&#92;&#48;' + 256));
             if ( i &lt; 0xB0A1) return &quot;*&quot;;
             if ( i &lt; 0xB0C5) return &quot;a&quot;;
             if ( i &lt; 0xB2C1) return &quot;b&quot;;
             if ( i &lt; 0xB4EE) return &quot;c&quot;;
             if ( i &lt; 0xB6EA) return &quot;d&quot;;
             if ( i &lt; 0xB7A2) return &quot;e&quot;;
             if ( i &lt; 0xB8C1) return &quot;f&quot;;
             if ( i &lt; 0xB9FE) return &quot;g&quot;;
             if ( i &lt; 0xBBF7) return &quot;h&quot;;
             if ( i &lt; 0xBFA6) return &quot;j&quot;;
             if ( i &lt; 0xC0AC) return &quot;k&quot;;
             if ( i &lt; 0xC2E8) return &quot;l&quot;;
             if ( i &lt; 0xC4C3) return &quot;m&quot;;
             if ( i &lt; 0xC5B6) return &quot;n&quot;;
             if ( i &lt; 0xC5BE) return &quot;o&quot;;
             if ( i &lt; 0xC6DA) return &quot;p&quot;;
             if ( i &lt; 0xC8BB) return &quot;q&quot;;
             if ( i &lt; 0xC8F6) return &quot;r&quot;;
             if ( i &lt; 0xCBFA) return &quot;s&quot;;
             if ( i &lt; 0xCDDA) return &quot;t&quot;;
             if ( i &lt; 0xCEF4) return &quot;w&quot;;
             if ( i &lt; 0xD1B9) return &quot;x&quot;;
             if ( i &lt; 0xD4D1) return &quot;y&quot;;
             if ( i &lt; 0xD7FA) return &quot;z&quot;;
             return &quot;*&quot;;
     }
    
     public static void main(String []g){
     System.out.println(getPYString(&quot;中国，,;$#@&amp;avc&quot;));
     }

}
</pre>
]]></content:encoded>
			<wfw:commentRss>https://falconia.org/blog/archives/197/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
