File tree Expand file tree Collapse file tree
src/main/java/org/apache/commons/io/input Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929import java .net .URL ;
3030import java .net .URLConnection ;
3131import java .text .MessageFormat ;
32+ import java .util .Locale ;
3233import java .util .regex .Matcher ;
3334import 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 ;
You can’t perform that action at this time.
0 commit comments