感觉比较难,我先到google找找

解决方案 »

  1.   

    呵呵,我这几天也在忙这个,这是我找到的一段文档,是节选的。看看下面的代码将 GB2312 文件转换成 Big5 文件,它们能够帮助我们理解 Java 中汉字编码的转化: ? import java.io.*; import java.util.*; ? public class gb2big5 { ? static int iCharNum=0; ? public static void main(String[] args) { System.out.println("Input GB2312 file, output Big5 file."); if (args.length!=2) { System.err.println("Usage: jview gb2big5 gbfile big5file"); System.exit(1); String inputString = readInput(args[0]); writeOutput(inputString,args[1]); System.out.println("Number of Characters in file: "+iCharNum+"."); } ? static void writeOutput(String str, String strOutFile) { try { FileOutputStream fos = new FileOutputStream(strOutFile); Writer out = new OutputStreamWriter(fos, "Big5"); out.write(str); out.close(); } catch (IOException e) { e.printStackTrace(); e.printStackTrace(); } } ? static String readInput(String strInFile) { StringBuffer buffer = new StringBuffer(); try { FileInputStream fis = new FileInputStream(strInFile); InputStreamReader isr = new InputStreamReader(fis, "GB2312"); Reader in = new BufferedReader(isr); int ch; while ((ch = in.read()) > -1) { iCharNum += 1; buffer.append((char)ch); } in.close(); return buffer.toString(); } catch (IOException e) { e.printStackTrace(); return null; } } } ? 编码转化的过程如下: GB2312------------------>Unicode------------->Big5 
      

  2.   

    GB2312->Unicode->Big5 这种能行吗?
    GB和big5之间不是直接可以对应的吧!我试一下可不可行!to  dai1016(D.M=3++) :
    哪有现成的?
      

  3.   

    如果两个字符串之间转换,用下面的方法就可以了String big5Str ;
    String gbStr ;big5Str = new String (gbStr.getBytes("gb2312"),"big5") ;
      

  4.   

    用这种方法的话,有些字无法正确转成BIG5的
      

  5.   

    建议去www.chinajavaworld.com,对此问题有人做了。