Package org.omegat.util
Class EncodingDetector
- java.lang.Object
-
- org.omegat.util.EncodingDetector
-
public final class EncodingDetector extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
detectEncoding(java.io.File inFile)
Detect the encoding of the supplied file.static java.lang.String
detectEncoding(java.io.InputStream stream)
Detect the encoding of the supplied file.static java.lang.String
detectEncodingDefault(java.io.File inFile, java.lang.String defaultEncoding)
Detect the encoding of the supplied file.
-
-
-
Method Detail
-
detectEncoding
public static java.lang.String detectEncoding(java.io.File inFile) throws java.io.IOException
Detect the encoding of the supplied file. Convenience method fordetectEncoding(java.io.InputStream)
.- Throws:
java.io.IOException
-
detectEncoding
public static java.lang.String detectEncoding(java.io.InputStream stream) throws java.io.IOException
Detect the encoding of the supplied file. The caller is responsible for closing the stream.
-
detectEncodingDefault
public static java.lang.String detectEncodingDefault(java.io.File inFile, java.lang.String defaultEncoding)
Detect the encoding of the supplied file. If detection fails, return the supplied default encoding.
-
-