Uploaded image for project: 'Log4cxx'
  1. Log4cxx
  2. LOGCXX-151

Umlauts as literal in patternlayout won't be logged correct

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.10.0
    • None
    • None
    • Windows XP SP2, Visual Studio 2003, source from svn head 3.8.2006

    Description

      I had problems to use umlauts as literal in my patternlayout: In the resulting log they were displayed as '?'. This happend while logging to file and to console.
      Then I compiled log4cxx with wchar_t:
      ant -Dhas.wchar_t=1 -Dlogchar=wchar_t build-projects-vc6 with-ODBC
      But this did not help. I debuged log4cxx and found that in the file patternparser.cpp in line 116 in the function PatternParser::parse() char c; should be logchar c; .
      I changed this for myself and it worked fine.
      The reason was the conversion from the logstring value type which is wchar_t to char.

      Also I tried to create a patch:

      Index: patternparser.cpp
      ===================================================================
      — patternparser.cpp (revision 428276)
      +++ patternparser.cpp (working copy)
      @@ -113,7 +113,7 @@

      int patternLength = pattern.length();
      int state = LITERAL_STATE;

      • char c;
        + logchar c;
        int i = 0;
        FormattingInfoPtr formattingInfo(FormattingInfo::getDefault());

      Attachments

        Activity

          People

            carnold@apache.org Curt Arnold
            cadams Christian Adams
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: