Summary: | Layout.setContentType() needed! | ||
---|---|---|---|
Product: | Log4j - Now in Jira | Reporter: | Bin Sun <sun2bin> |
Component: | Layout | Assignee: | log4j-dev <log4j-dev> |
Status: | RESOLVED WORKSFORME | ||
Severity: | blocker | ||
Priority: | P3 | ||
Version: | 1.2 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All |
Description
Bin Sun
2004-11-05 02:40:11 UTC
Character encoding and content text are different concepts and it would be wrong to try to combine them. Character encoding is appropriately handled at the appender, not the layout. Layout's are always dealing with UTF-16 characters, the appenders are responsible for converting that to a byte stream. WriterAppender derived appenders have an Encoding attribute that allows you to specify the encoding to be used. Perhaps in your use case, that was not appropriately set or the appender in use does not appropriately control or report the encoding. getContentType() is overriden in application specific layouts such as HTMLLayout (which returns text/ html) and XMLLayout (which I was surprised doesn't return text/xml). I agree with Curt's comments, so I'm closing this issue. setEncoding methods are available and (in my experience with non-en_us locales) correctly implemented. |