Fixes #169 (Uppercase problem in XMLReader)
This commit is contained in:
parent
7fba97122f
commit
b43bbb8bb2
1 changed files with 3 additions and 2 deletions
|
@ -29,6 +29,7 @@ import java.net.HttpURLConnection;
|
|||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Locale;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
@ -558,7 +559,7 @@ public class XmlReader extends Reader {
|
|||
final String postMime = httpContentType.substring(i + 1);
|
||||
final Matcher m = CHARSET_PATTERN.matcher(postMime);
|
||||
encoding = m.find() ? m.group(1) : null;
|
||||
encoding = encoding != null ? encoding.toUpperCase() : null;
|
||||
encoding = encoding != null ? encoding.toUpperCase(Locale.ENGLISH) : null;
|
||||
}
|
||||
if (encoding != null && (encoding.startsWith("\"") && encoding.endsWith("\"") || encoding.startsWith("'") && encoding.endsWith("'"))) {
|
||||
encoding = encoding.substring(1, encoding.length() - 1);
|
||||
|
@ -655,7 +656,7 @@ public class XmlReader extends Reader {
|
|||
}
|
||||
final Matcher m = ENCODING_PATTERN.matcher(prolog);
|
||||
if (m.find()) {
|
||||
encoding = m.group(1).toUpperCase();
|
||||
encoding = m.group(1).toUpperCase(Locale.ENGLISH);
|
||||
encoding = encoding.substring(1, encoding.length() - 1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue