headers icon indicating copy to clipboard operation
headers copied to clipboard

Charset for html

Open troelsarvin opened this issue 3 years ago • 1 comments

headers has a text_utf8 constructor for ContentType. I suggest a html_utf8 constructor be added, as well, resulting in

Content-Type: text/html; charset=utf-8

Motivation: If the charset is not set for the text/html content type, then it defaults to ISO-8859-1, but in many situations, the charset is really UTF-8.

troelsarvin avatar Apr 18 '22 10:04 troelsarvin

Maybe it would be possible to have ContentType::utf8(self) -> Self and deprecate ContentType::text_utf8() in favor of ContentType::text().utf8()?

jplatte avatar Apr 18 '22 11:04 jplatte