Skip to content

Commit 31114f3

Browse files
author
Timothy O'Brien
committed
ENCODING was a static final variable, but it was only
accessed from non-static methods. This field was alter to be non-static and non-final. A constructor was added to allow the end-user to set a custom Encoding. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/codec/trunk@130208 13f79535-47bb-0310-9956-ffa450edef68
1 parent 83b6ded commit 31114f3

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
*
8787
* @author <a href="mailto:oleg@ural.ru">Oleg Kalnichevski</a>
8888
* @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a>
89-
* @version $Id: URLCodec.java,v 1.7 2003/10/05 21:45:49 tobrien Exp $
89+
* @version $Id: URLCodec.java,v 1.8 2003/10/12 02:17:11 tobrien Exp $
9090
*/
9191

9292
public class URLCodec
@@ -97,7 +97,7 @@ public class URLCodec
9797
/**
9898
* The <code>String</code> encoding used for decoding and encoding.
9999
*/
100-
protected static final String ENCODING = "US-ASCII";
100+
protected String ENCODING = "US-ASCII";
101101

102102
/**
103103
* BitSet of www-form-url safe characters.
@@ -134,6 +134,14 @@ public URLCodec() {
134134
super();
135135
}
136136

137+
/**
138+
* Constructor which allows for the selection of an Encoding
139+
*/
140+
public URLCodec(String encoding) {
141+
super();
142+
ENCODING = encoding;
143+
}
144+
137145
/**
138146
* Encodes an array of bytes into an array of URL safe 7-bit
139147
* characters. Unsafe characters are escaped.

0 commit comments

Comments
 (0)