/** * Unicode文字コード一覧表を生成するユーティリティ * Copyright (C) 2000 Midori IGA * (http://www01.u-page.so-net.ne.jp/db3/midori/midosoft.html) */ import java.io.*; public class MdUnicodeList { public static final void main(String[] args) { try{ PrintStream outStream=new PrintStream(new FileOutputStream("MdUnicodeList.unicode.out")); for(int iLoop=0;iLoop<0xffff;iLoop++) { char[] cTest=new char[1]; cTest[0]=(char)iLoop; String strTest=new String(cTest); MdDump.dumpBytesWithoutFormat(outStream,MdDump.string2bytes(strTest)); outStream.println(": "+strTest); } outStream.flush(); outStream.close(); }catch(IOException ex){ System.out.println(ex.toString()); ex.printStackTrace(); } reportEncodingResult("MS932"); reportEncodingResult("SJIS"); } protected static void reportEncodingResult(String strEncoding) { try{ PrintStream outStream=new PrintStream(new FileOutputStream("MdUnicodeList."+strEncoding+".out")); for(int iLoop=0;iLoop<0xffff;iLoop++) { char[] cTest=new char[1]; cTest[0]=(char)iLoop; String strTest=new String(cTest); byte[] byteResult=strTest.getBytes(strEncoding); if(!(byteResult[0]==0x3f && byteResult.length==1) || iLoop==0x3f) { MdDump.dumpBytesWithoutFormat(outStream,byteResult); outStream.println(": "+strTest); } } outStream.flush(); outStream.close(); }catch(IOException ex){ System.out.println(ex.toString()); ex.printStackTrace(); } } }