commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r798416 - /commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/URLCodec.java
Date Tue, 28 Jul 2009 06:35:58 GMT
Author: ggregory
Date: Tue Jul 28 06:35:58 2009
New Revision: 798416

URL: http://svn.apache.org/viewvc?rev=798416&view=rev
Log:
Use existing ESCAPE_CHAR instead of magic char.

Modified:
    commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/URLCodec.java

Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/URLCodec.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/URLCodec.java?rev=798416&r1=798415&r2=798416&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/URLCodec.java (original)
+++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/URLCodec.java Tue Jul
28 06:35:58 2009
@@ -141,7 +141,7 @@
                 }
                 buffer.write(b);
             } else {
-                buffer.write('%');
+                buffer.write(ESCAPE_CHAR);
                 char hex1 = Character.toUpperCase(Character.forDigit((b >> 4) &
0xF, RADIX));
                 char hex2 = Character.toUpperCase(Character.forDigit(b & 0xF, RADIX));
                 buffer.write(hex1);
@@ -169,7 +169,7 @@
             int b = bytes[i];
             if (b == '+') {
                 buffer.write(' ');
-            } else if (b == '%') {
+            } else if (b == ESCAPE_CHAR) {
                 try {
                     int u = Utils.digit16(bytes[++i]);
                     int l = Utils.digit16(bytes[++i]);



Mime
View raw message