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 {//w ww .  j  a  v  a 2s.c o m
      BufferedReader in = new BufferedReader(new InputStreamReader(
          new FileInputStream("infilename"), "8859_1"));
      String str = in.readLine();
    } catch (UnsupportedEncodingException e) {
    } catch (IOException e) {
    }
  }
}

Related Tutorials