文选流氓 发表于 2003-5-11 22:37

1-1-16-2-8 How to convert Unicode to GB code in Java

发信人: corpus (corpora), 信区: Java
标题: How to convert Unicode to GB code in Java
发信站: BBS 水木清华站 (Thu Feb 26 08:26:14 1998) WWW-POST

I can do it now.

example:



import sun.io.ByteToCharConverter;

import sun.io.CharToByteConverter;

/* some other code */



CharToByteConverter fromUnicode

= CharToByteConverter.getConverter("GB2312");

byte gbBytes[] = fromUnicode.convertAll(unicodeString);
页: [1]
查看完整版本: 1-1-16-2-8 How to convert Unicode to GB code in Java