You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2005/05/11 22:30:51 UTC

DO NOT REPLY [Bug 34874] New: - XMLLayout and HTMLLayout do not detect use of incompatible encoding

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34874>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34874

           Summary: XMLLayout and HTMLLayout do not detect use of
                    incompatible encoding
           Product: Log4j
           Version: 1.3alpha
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Layout
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: carnold@apache.org


XMLLayout and HTMLLayout assume that the encoding of any associated writer is either UTF-8 or 
UTF-16.  If an encoding is not explicitly specified in the appender, the default platform encoding will be 
used which is highly unlikely to be UTF-8 or UTF-16 on Windows.  A mismatch in encoding will result in 
non-wellformed XML documents if a non-US-ASCII character is emitted in the log.

The proposed resolution is to add a new interface

interface EncodingSensitiveLayout {
    /*  @return encoding selected by layout  */ 
    String setEncoding(final String proposedEncoding);
}

to be implemented by XMLLayout and HTMLLayout.  In  the WriterAppender.activateOptions, if the 
layout supported EncodingSensitiveLayout, it would be passed the proposed encoding and would have a 
chance to either modify its behavior to be consistent with that encoding or to override the choice of 
encoding.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org