private static int getChsAscii(String chs) {
		int asc = 0;
		byte[] bytes = chs.getBytes(CharsetUtil.CHARSET_GBK);
		switch (bytes.length) {
		case 1:
			// 英文字符
			asc = bytes[0];
			break;
		case 2:
			// 中文字符
			int hightByte = 256 + bytes[0];
			int lowByte = 256 + bytes[1];
			asc = (256 * hightByte + lowByte) - 256 * 256;
			break;
		default:
			throw new UtilException("Illegal resource string");
		}
		return asc;
	}
private static int getChsAscii ( String chs ) { int asc = 0 ; byte [ ] bytes = chs . getBytes ( CharsetUtil . CHARSET_GBK ) ; switch ( bytes . length ) { case 1 : asc = bytes [ 0 ] ; break ; case 2 : int hightByte = 256 + bytes [ 0 ] ; int lowByte = 256 + bytes [ 1 ] ; asc = ( 256 * hightByte + lowByte ) - 256 * 256 ; break ; default : throw new UtilException ( "Illegal resource string" ) ; } return asc ; }
获取汉字对应的ascii码
@param chs 汉字
@return ascii码