Skip to content

Commit 95de62c

Browse files
committed
Use existing ESCAPE_CHAR instead of magic char.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@798416 13f79535-47bb-0310-9956-ffa450edef68
1 parent 31a3522 commit 95de62c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/java/org/apache/commons/codec/net/URLCodec.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public static final byte[] encodeUrl(BitSet urlsafe, byte[] bytes) {
141141
}
142142
buffer.write(b);
143143
} else {
144-
buffer.write('%');
144+
buffer.write(ESCAPE_CHAR);
145145
char hex1 = Character.toUpperCase(Character.forDigit((b >> 4) & 0xF, RADIX));
146146
char hex2 = Character.toUpperCase(Character.forDigit(b & 0xF, RADIX));
147147
buffer.write(hex1);
@@ -169,7 +169,7 @@ public static final byte[] decodeUrl(byte[] bytes) throws DecoderException {
169169
int b = bytes[i];
170170
if (b == '+') {
171171
buffer.write(' ');
172-
} else if (b == '%') {
172+
} else if (b == ESCAPE_CHAR) {
173173
try {
174174
int u = Utils.digit16(bytes[++i]);
175175
int l = Utils.digit16(bytes[++i]);

0 commit comments

Comments
 (0)