Package com.jalios.util
Class CharsetDetector
java.lang.Object
com.jalios.util.CharsetDetector
This class allow one to detect charset encoding of any given file or input stream.
It uses the Mozilla Charset Detectors API.
http://jchardet.sourceforge.net/index.html
http://www.mozilla.org/projects/intl/chardet.html
http://jchardet.sourceforge.net/index.html
http://www.mozilla.org/projects/intl/chardet.html
- Since:
- jcms-5.5.0
- Author:
- Olivier Jaquemet
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.mozilla.intl.chardet.nsDetectorprotected String -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
det
protected final org.mozilla.intl.chardet.nsDetector det -
foundCharset
-
-
Constructor Details
-
CharsetDetector
public CharsetDetector()
-
-
Method Details
-
detect
Detects and returns the probable charset of the given File.- Returns:
- a charset encoding or null if nothing could be found.
-
detect
Detects and returns the probable charset of the given InputStream.- Returns:
- a charset encoding or null if nothing could be found.
-