1.使用方法
String s=GetChineseFirstUtil.getSpells("你");
2.工具类代码:
import java.io.UnsupportedEncodingException;
public class GetChineseFirstUtil {
static final int GB_SP_DIFF = 160;
static final int[] secPosValueList = { 1601, 1637, 1833, 2078, 2274, 2302,
2433, 2594, 2787, 3106, 3212, 3472, 3635, 3722, 3730, 3858, 4027,
4086, 4390, 4558, 4684, 4925, 5249, 5600 };
static final char[] firstLetter = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'w', 'x',
'y', 'z' };
public static String getSpells(String characters) {
StringBuffer buffer = new StringBuffer();