#389 UTF8 encoding error in XMLLogger

release_4.2
closed
Oliver Burn
None
5
2012-10-10
2005-11-29
Dirk Datzert
No

Hi,

in
com.puppycrawl.tools.checkstyle.XMLLogger.setOutputStream()
it should read 'UTF-8' instead of 'UTF8' according to
the charset definition from
http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html

http://cvs.sourceforge.net/viewcvs.py/checkstyle/checkstyle/src/checkstyle/com/puppycrawl/tools/checkstyle/XMLLogger.java?rev=1.25&view=auto

/**
 * sets the OutputStream
 * @param aOS the OutputStream to use
 **/
private void setOutputStream(OutputStream aOS)
{
    try {
  • final OutputStreamWriter osw = new
    OutputStreamWriter(aOS, "UTF8");
  • final OutputStreamWriter osw = new
    OutputStreamWriter(aOS, "UTF-8");
    mWriter = new PrintWriter(osw);
    }
    catch (UnsupportedEncodingException e) {
    // unlikely to happen...
    throw new ExceptionInInitializerError(e);
    }
    }

Regards,
Dirk

Discussion

  • Oliver Burn
    Oliver Burn
    2006-01-16

    Logged In: YES
    user_id=218824

    Thanks - fixed.