トップ 一覧 ping 検索 ヘルプ RSS ログイン

Shift JIS 文字一覧を作成の変更点

  • 追加された行はこのように表示されます。
  • 削除された行はこのように表示されます。
!!!Shift JIS 文字一覧を作成の編集
*[Microsoftコードページ932|http://ja.wikipedia.org/wiki/Microsoft%E3%82%B3%E3%83%BC%E3%83%89%E3%83%9A%E3%83%BC%E3%82%B8932]
*[Unicode|http://ja.wikipedia.org/wiki/Unicode]

::Shift JIS 漢字一覧(1〜3)のテキストファイルを作成する

{{ref_image 01.JPG}}

 public class CreateShiftJISCharSet {
     public static void main(String[] args) {
         CreateShiftJISCharSet test = new CreateShiftJISCharSet();
         try {
             test.doPrintChars("c:\\work\\kanji1.txt", 0x88, 0x98);
             test.doPrintChars("c:\\work\\kanji2.txt", 0x98, 0xea);
             test.doPrintChars("c:\\work\\kanji3.txt", 0xfa, 0xfc);
             
         } catch (Exception e) {
             e.printStackTrace();
         }
     }
     
     private void doPrintChars(String outFileName, int start, int end) throws Exception {
         File out = new File(outFileName);
         
         BufferedWriter writer = new BufferedWriter(new FileWriter(out));
         
         for (int hb = start; hb<=end; hb++) {
             for (int lb = 0x40; lb<=0xff; lb++) {
                 if (((lb - 0x40) % 0x10) == 0) {
                     writer.write(new String(new byte[]{0x0d,0x0a}, "MS932"));
                 }
                 byte[] c = {(byte)hb, (byte)lb};
                 writer.write(new String(c, "MS932"));
             }
         }
         writer.flush();
         System.out.println("finish.");
     }
 }

生成後、"?" などの文字を上記IMEを確認しながら編集する。
{{ref Shift_JIS 漢字1.txt}}
{{ref Shift_JIS 漢字2.txt}}
{{ref Shift_JIS 漢字3.txt}}

{{ref 01.JPG}}
----
{{include_html banner_html, "!Java"}}