com.jalios.util
Class CharsetDetector
java.lang.Object
  
com.jalios.util.CharsetDetector
public class CharsetDetector
- extends Object
 
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
- Since:
 
  - jcms-5.5.0
 
- Version:
 
  - $Revision: 15020 $
 
- Author:
 
  - Olivier Jaquemet 
 
 
 
| 
Method Summary | 
 String | 
detect(File file)
 
          Detects and returns the probable charset of the given File. | 
 String | 
detect(InputStream is)
 
          Detects and returns the probable charset of the given InputStream. | 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
REVISION
public static final String REVISION
- See Also:
 - Constant Field Values
 
det
protected final org.mozilla.intl.chardet.nsDetector det
foundCharset
protected String foundCharset
CharsetDetector
public CharsetDetector()
detect
public String detect(File file)
- Detects and returns the probable charset of the given File.
- Returns:
 - a charset encoding or null if nothing could be found.
 
 
 
detect
public String detect(InputStream is)
- Detects and returns the probable charset of the given InputStream.
- Returns:
 - a charset encoding or null if nothing could be found.
 
 
 
Copyright © 2001-2010 Jalios SA. All Rights Reserved.