当前位置: 技术问答>java相关
请问motoA6288+的汉字编码 100分马上给
来源: 互联网 发布时间:2015-06-21
本文导语: 请问motoA6288+的汉字编码 100分马上给 | /** * Convert string to bytes for Chinese and other two-byte characters */ public static byte[] stringToBytes(String ss) { ssLen = ss.length(); ...
请问motoA6288+的汉字编码 100分马上给
|
/**
* Convert string to bytes for Chinese and other two-byte characters
*/
public static byte[] stringToBytes(String ss)
{
ssLen = ss.length();
cc = ss.toCharArray();
ssBuffer = new byte[ssLen*2];
for(i=0;i>8);
}
return ssBuffer;
}
/**
* Convert bytes to string for Chinese and other two-byte characters
*/
public static String bytesToString(byte[] ssBuffer, int offset, int length)
{
ssLen = (length&0xff)/2;
cc = new char[ssLen];
for(i=0;i
* Convert string to bytes for Chinese and other two-byte characters
*/
public static byte[] stringToBytes(String ss)
{
ssLen = ss.length();
cc = ss.toCharArray();
ssBuffer = new byte[ssLen*2];
for(i=0;i>8);
}
return ssBuffer;
}
/**
* Convert bytes to string for Chinese and other two-byte characters
*/
public static String bytesToString(byte[] ssBuffer, int offset, int length)
{
ssLen = (length&0xff)/2;
cc = new char[ssLen];
for(i=0;i