Reading ISO Latin-1 Encoded Data - Java Internationalization

Java examples for Internationalization:Charset

Description

Reading ISO Latin-1 Encoded Data

Demo Code

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;

public class Main {
  public static void main(String[] args) throws Exception {
    try {//from   ww  w .  j ava2 s. com
      BufferedReader in = new BufferedReader(new InputStreamReader(
          new FileInputStream("infilename"), "8859_1"));
      String str = in.readLine();
    } catch (UnsupportedEncodingException e) {
    } catch (IOException e) {
    }
  }
}

Related Tutorials