/src/main/java/org/apache/maven/doxia/DefaultConverter.java
CharsetDetector detector = new CharsetDetector( ) ; try ( InputStream is = new BufferedInputStream( new FileInputStream( f) ) ) {
try ( InputStream is = new BufferedInputStream ( new FileInputStream ( f ) ) ) { CharsetDetector detector = new CharsetDetector ( ) ;
try { if (XmlUtil.isXml(f)) { try (XmlStreamReader reader = new XmlStreamReader(f)) { return reader.getEncoding(); } } <extra_id_0> detector.setText(is); CharsetMatch match = detector.detect(); return match.getName().toUpperCase(Locale.ENGLISH); } } catch (IOException e) { }