https://issues.apache.org/bugzilla/show_bug.cgi?id=44644


Илья Казначеев <[EMAIL PROTECTED]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW




--- Comment #2 from Илья Казначеев <[EMAIL PROTECTED]>  2008-08-28 08:15:03 PST 
---
Surely I do!

import org.apache.log4j.Logger;
import org.apache.log4j.SimpleLayout;
import org.apache.log4j.net.SMTPAppender;

public class testlog {

        private static Logger logger =
        Logger.getLogger("testlog");

        public static void main(String[] args)
        {
                        SMTPAppender appender = new SMTPAppender();
                       
appender.setSMTPHost("alt1.gmail-smtp-in.l.google.com");
                        appender.setFrom(args[0]);
                        appender.setName("CHARSETMAIL");
                        appender.setSubject("Encoding FAIL");
                        appender.setTo(args[0]);
                        appender.setLayout(new SimpleLayout() {
                                @Override
                                public String getContentType()
                                {
                                        return "text/plain; charset=\"UTF-8\"";
                                }
                        });
                        appender.activateOptions();
                        logger.addAppender(appender);

                logger.error("Μπορῶ νὰ φάω σπασμένα
γυαλιὰ χωρὶς νὰ πάθω τίποτα. \n Ek get etið gler án
þess að verða sár. \n Я магу есці шкло, яно мне не
шкодзіць.\n\n");
        }

}

Try running it as java -cp .:log4j-1.2.14.jar:mail.jar:activation.jar testlog
[EMAIL PROTECTED]
With and without the anonymous subclass.

With it, you'll get proper message with greek and cyrillic; without it, you'll
get question marks instead of those characters.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to