public Charset getCharset ( ) { // RFC2616 3.7 for ( String type : this . request . headers ( ) . getAll ( "Content-Type" ) ) { int idx = type . toUpperCase ( ) . indexOf ( "CHARSET=" ) ; if ( idx > 1 ) { String charset = type . substring ( idx + 8 ) ; return Charset . forName ( charset ) ; } } return Charset . forName ( "UTF-8" ) ; }
Attempts to parse the character set from the request header . If not set defaults to UTF - 8