Java UTF8 openFileUTF(String nom)

Here you can find the source of openFileUTF(String nom)

Description

open File UTF

License

Open Source License

Declaration

public static BufferedReader openFileUTF(String nom) throws FileNotFoundException 

Method Source Code


//package com.java2s;
/*/*from w  w w  . j  a  va 2  s .  c o  m*/
This source code is copyrighted by Christophe Cerisara, CNRS, France.
    
It is licensed under the terms of the INRIA Cecill-C licence, as described in:
http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.html
 */

import java.io.*;

import java.nio.charset.Charset;

public class Main {
    /** @deprecated use getUTF8Reader instead */
    public static BufferedReader openFileUTF(String nom) throws FileNotFoundException {
        return getUTF8Reader(new File(nom));
    }

    public static BufferedReader getUTF8Reader(File f) throws FileNotFoundException {
        return new BufferedReader(
                new InputStreamReader(new FileInputStream(f), Charset.forName("UTF-8").newDecoder()));
    }
}

Related

  1. isUtf8Supported()
  2. loadStringUTF8(InputStream in)
  3. makeUTF8()
  4. moveFile(File inFile, File outFile)
  5. newUTF8Decoder()
  6. putUTF8(byte[] data, int offset, String str)
  7. sort(String inFile, int keyIndex, String outFile)
  8. stringFromBytesUTF8(byte[] bytes)
  9. stringToUtf8(String str)