geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r947075 - in /geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail: store/imap/connection/ store/pop3/connection/ transport/nntp/
Date Fri, 21 May 2010 17:12:20 GMT
Author: rickmcguire
Date: Fri May 21 17:12:20 2010
New Revision: 947075

URL: http://svn.apache.org/viewvc?rev=947075&view=rev
Log:
GERONIMO-5326 Geronimo javamail does not work on non-ASCII platforms

A couple more places that required updating. 


Modified:
    geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/store/imap/connection/IMAPResponse.java
    geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/store/pop3/connection/POP3Connection.java
    geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/transport/nntp/NNTPConnection.java

Modified: geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/store/imap/connection/IMAPResponse.java
URL: http://svn.apache.org/viewvc/geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/store/imap/connection/IMAPResponse.java?rev=947075&r1=947074&r2=947075&view=diff
==============================================================================
--- geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/store/imap/connection/IMAPResponse.java
(original)
+++ geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/store/imap/connection/IMAPResponse.java
Fri May 21 17:12:20 2010
@@ -16,6 +16,8 @@
  */
 
 package org.apache.geronimo.javamail.store.imap.connection;
+import java.io.UnsupportedEncodingException;
+
 import javax.mail.MessagingException;
 
 /**
@@ -60,6 +62,10 @@ public class IMAPResponse {
      * @return The string version of the response. 
      */
     public String toString() {
+        try {
+            return new String(response, "US-ASCII");
+        } catch (UnsupportedEncodingException e) {
+        }
         return new String(response);
     }
 }

Modified: geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/store/pop3/connection/POP3Connection.java
URL: http://svn.apache.org/viewvc/geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/store/pop3/connection/POP3Connection.java?rev=947075&r1=947074&r2=947075&view=diff
==============================================================================
--- geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/store/pop3/connection/POP3Connection.java
(original)
+++ geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/store/pop3/connection/POP3Connection.java
Fri May 21 17:12:20 2010
@@ -307,7 +307,7 @@ public class POP3Connection extends Mail
         // it's more efficient to do this a buffer at a time.
         // the MIMEInputReader takes care of the byte-stuffing and
         // ".\r\n" input terminator for us.
-        OutputStreamWriter outWriter = new OutputStreamWriter(out);
+        OutputStreamWriter outWriter = new OutputStreamWriter(out, Charset.forName("ISO8859-1"));
         char buffer[] = new char[500];
         try {
             int charsRead = -1;

Modified: geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/transport/nntp/NNTPConnection.java
URL: http://svn.apache.org/viewvc/geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/transport/nntp/NNTPConnection.java?rev=947075&r1=947074&r2=947075&view=diff
==============================================================================
--- geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/transport/nntp/NNTPConnection.java
(original)
+++ geronimo/javamail/trunk/geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/transport/nntp/NNTPConnection.java
Fri May 21 17:12:20 2010
@@ -25,6 +25,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.OutputStream;
+import java.io.OutputStreamWriter;
 import java.io.PrintStream;
 import java.io.PrintWriter;
 import java.io.UnsupportedEncodingException;
@@ -141,7 +142,7 @@ public class NNTPConnection extends Mail
         // set the encoding to ensure that an inappropriate native encoding is not picked
up.
         Charset iso88591 = Charset.forName("ISO8859-1");
         reader = new BufferedReader(new InputStreamReader(inputStream, iso88591));
-        writer = new PrintWriter(new BufferedOutputStream(outputStream));
+        writer = new PrintWriter(new OutputStreamWriter(new BufferedOutputStream(outputStream),
iso88591));
     }
 
 



Mime
View raw message