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=31161>.
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=31161

URLCodec.decode() corrupts characters > 127 in unencoded strings





------- Additional Comments From [EMAIL PROTECTED]  2004-09-10 21:14 -------
Gary,
I _personally_ do not think this case is generic enough to warrant any
modifications to the stock version of [codec]. What _might_ be possible is use
the system default encoding instead of ASCII. However, that would effectively
mean that the URLCodec could produce erroneous results on those platforms where
the system encoding is not backward compatible with US-ASCII (for instance on
the IBM platforms that use EBCDIC charset, like OS/400)

Here's what the patch migth look like. This said, I am -1 on this change

Index: URLCodec.java
===================================================================
RCS file:
/home/cvspublic/jakarta-commons/codec/src/java/org/apache/commons/codec/net/URLCodec.java,v
retrieving revision 1.19
diff -u -r1.19 URLCodec.java
--- URLCodec.java       29 Mar 2004 07:59:00 -0000      1.19
+++ URLCodec.java       10 Sep 2004 21:03:42 -0000
@@ -223,7 +223,7 @@
         if (pString == null) {
             return null;
         }
-        return new String(encode(pString.getBytes(charset)),
StringEncodings.US_ASCII);
+        return new String(encode(pString.getBytes(charset)));
     }
 
 
@@ -267,7 +267,7 @@
         if (pString == null) {
             return null;
         }
-        return new String(decode(pString.getBytes(StringEncodings.US_ASCII)),
charset);
+        return new String(decode(pString.getBytes()), charset);
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to