public static String getCharsetFromContentType ( Header header ) { if ( header == null || header . getValue ( ) == null || "" . equals ( header . getValue ( ) ) ) return null ; Matcher m = charsetPattern . matcher ( header . getValue ( ) ) ; if ( m . find ( ) ) { return m . group ( 1 ) . trim ( ) . toUpperCase ( ) ; } return null ; }
Parse out a charset from a content type header .