withCharsetIfNeeded

fun ContentType.withCharsetIfNeeded(charset: Charset): ContentType

Creates a copy of this type with the added charset parameter with charset value if ContentType is not ignored