okhttp / okhttp3 / MediaType / charset

charset

@JvmOverloads fun charset(defaultValue: Charset? = null): Charset?

Returns the charset of this media type, or defaultValue if either this media type doesn't specify a charset, of it its charset is unsupported by the current runtime.