Java_iso8859 のバックアップソース(No.1) - アールメカブ

アールメカブ


Java_iso8859 のバックアップソース(No.1)

[[Java_FileReader]]

* FileInputStream を使った iso-8859-1 の補足 2005 09 16 [#j5aa48b5]

 class iso8859 {
   public static void main(String[] args) {
    try {
        FileInputStream is = new FileInputStream("file.txt");
        InputStreamReader in = new InputStreamReader(is, 
         "ISO-8859-1");
         int ch;
         while ((ch = in.read()) != -1) {
               System.out.print(Integer.toHexString(ch) + " ");
               if(ch == 0xe4){// aウムラウトを補足
             	System.out.print("← a-umlaut ");
                }
            }
           in.close();
        } catch (IOException e) {
            System.out.println(e);
        }
     }
  }