private JsonEncoding getJsonEncoding ( MediaType contentType ) { if ( contentType != null && contentType . getCharset ( ) != null ) { Charset charset = contentType . getCharset ( ) ; for ( JsonEncoding encoding : JsonEncoding . values ( ) ) { if ( charset . name ( ) . equals ( encoding . getJavaName ( ) ) ) { return encoding ; } } } return JsonEncoding . UTF8 ; }
Determine the JSON encoding to use for the given content type .