Variable: htmlize-html-charset
htmlize-html-charset is a customizable variable defined in htmlize.el.
Value
nil
Documentation
The charset declared by the resulting HTML documents.
When non-nil, causes htmlize to insert the following in the HEAD section of the generated HTML:
<meta http-equiv="Content-Type" content="text/html; charset=CHARSET">
where CHARSET is the value you've set for htmlize-html-charset. Valid
charsets are defined by MIME and include strings like "iso-8859-1",
"iso-8859-15", "utf-8", etc.
If you are using non-Latin-1 charsets, you might need to set this for your documents to render correctly. Also, the W3C validator requires submitted HTML documents to declare a charset. So if you care about validation, you can use this to prevent the validator from bitching.
Needless to say, if you set this, you should actually make sure that
the buffer is in the encoding you're claiming it is in. (This is
normally achieved by using the correct file coding system for the
buffer.) If you don't understand what that means, you should probably
leave this option in its default setting.
Source Code
;; Defined in ~/.emacs.d/elpa/htmlize-20250724.1703/htmlize.el
(defcustom htmlize-html-charset nil
"The charset declared by the resulting HTML documents.
When non-nil, causes htmlize to insert the following in the HEAD section
of the generated HTML:
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=CHARSET\">
where CHARSET is the value you've set for htmlize-html-charset. Valid
charsets are defined by MIME and include strings like \"iso-8859-1\",
\"iso-8859-15\", \"utf-8\", etc.
If you are using non-Latin-1 charsets, you might need to set this for
your documents to render correctly. Also, the W3C validator requires
submitted HTML documents to declare a charset. So if you care about
validation, you can use this to prevent the validator from bitching.
Needless to say, if you set this, you should actually make sure that
the buffer is in the encoding you're claiming it is in. (This is
normally achieved by using the correct file coding system for the
buffer.) If you don't understand what that means, you should probably
leave this option in its default setting."
:type '(choice (const :tag "Unset" nil)
string)
:group 'htmlize)