Skip to content

Commit 5db7f80

Browse files
committed
Use fixed Locale for upcasing
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1299947 13f79535-47bb-0310-9956-ffa450edef68
1 parent 027d941 commit 5db7f80

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/java/org/apache/commons/io/input/XmlStreamReader.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import java.net.URL;
3030
import java.net.URLConnection;
3131
import java.text.MessageFormat;
32+
import java.util.Locale;
3233
import java.util.regex.Matcher;
3334
import java.util.regex.Pattern;
3435

@@ -628,7 +629,7 @@ static String getContentTypeMime(String httpContentType) {
628629
* httpContentType is NULL.
629630
*
630631
* @param httpContentType the HTTP content type
631-
* @return The content type encoding
632+
* @return The content type encoding (upcased)
632633
*/
633634
static String getContentTypeEncoding(String httpContentType) {
634635
String encoding = null;
@@ -638,7 +639,7 @@ static String getContentTypeEncoding(String httpContentType) {
638639
String postMime = httpContentType.substring(i + 1);
639640
Matcher m = CHARSET_PATTERN.matcher(postMime);
640641
encoding = (m.find()) ? m.group(1) : null;
641-
encoding = (encoding != null) ? encoding.toUpperCase() : null;
642+
encoding = (encoding != null) ? encoding.toUpperCase(Locale.US) : null;
642643
}
643644
}
644645
return encoding;

0 commit comments

Comments
 (0)