List of utility methods to do GB2312 to String Convert
String | gb2312ToString(byte[] b) gb To String return gb2312ToString(b, 0, b.length);
|
String | gb2312ToString(byte[] b, int offset, int len) gb To String byte[] buf = new byte[len]; for (int i = 0; i < len / 2; i++) { if (b[offset + i * 2] != '\0') { buf[i * 2] = (byte) (b[offset + i * 2] | 0x80); buf[i * 2 + 1] = (byte) b[offset + i * 2 + 1]; } else { buf[i * 2] = '\0'; buf[i * 2 + 1] = '\0'; ... |