Lines 174-181
public final class RequestUtil {
Link Here
|
174 |
* |
174 |
* |
175 |
* @param map Map that accumulates the resulting parameters |
175 |
* @param map Map that accumulates the resulting parameters |
176 |
* @param data Input string containing request parameters |
176 |
* @param data Input string containing request parameters |
177 |
* @param encoding The encoding to use; if null, the default encoding is |
177 |
* @param encoding The encoding to use; encoding must not be null. |
178 |
* used. If an unsupported encoding is specified the parameters will not be |
178 |
* If an unsupported encoding is specified the parameters will not be |
179 |
* parsed and the map will not be modified |
179 |
* parsed and the map will not be modified |
180 |
*/ |
180 |
*/ |
181 |
public static void parseParameters(Map<String,String[]> map, String data, |
181 |
public static void parseParameters(Map<String,String[]> map, String data, |
Lines 184-198
public final class RequestUtil {
Link Here
|
184 |
if ((data != null) && (data.length() > 0)) { |
184 |
if ((data != null) && (data.length() > 0)) { |
185 |
|
185 |
|
186 |
// use the specified encoding to extract bytes out of the |
186 |
// use the specified encoding to extract bytes out of the |
187 |
// given string so that the encoding is not lost. If an |
187 |
// given string so that the encoding is not lost. |
188 |
// encoding is not specified, let it use platform default |
|
|
189 |
byte[] bytes = null; |
188 |
byte[] bytes = null; |
190 |
try { |
189 |
try { |
191 |
if (encoding == null) { |
190 |
bytes = data.getBytes(B2CConverter.getCharset(encoding)); |
192 |
bytes = data.getBytes(Charset.defaultCharset()); |
|
|
193 |
} else { |
194 |
bytes = data.getBytes(B2CConverter.getCharset(encoding)); |
195 |
} |
196 |
parseParameters(map, bytes, encoding); |
191 |
parseParameters(map, bytes, encoding); |
197 |
} catch (UnsupportedEncodingException uee) { |
192 |
} catch (UnsupportedEncodingException uee) { |
198 |
if (log.isDebugEnabled()) { |
193 |
if (log.isDebugEnabled()) { |