Skip to content

Commit

Permalink
Ensure the docs are read as utf8
Browse files Browse the repository at this point in the history
  • Loading branch information
danakj committed Dec 25, 2023
1 parent 5cbb4a7 commit ca224fc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions subdoc/lib/gen/generate_head.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ void generate_head(HtmlWriter& html, std::string_view title,
const Options& options) noexcept {
{
auto head = html.open_head();
{
auto meta = head.open_meta();
meta.add_content("text/html;charset=utf-8");
meta.add_http_equiv("Content-Type");
}
{
auto meta = head.open_meta();
meta.add_name("generator");
Expand Down
7 changes: 7 additions & 0 deletions subdoc/lib/gen/html_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,13 @@ class HtmlWriter {
});
}

void add_http_equiv(std::string_view value) {
attributes_.push(HtmlAttribute{
.name = std::string("http-equiv"),
.value = std::string(value),
});
}

void add_name(std::string_view value) {
attributes_.push(HtmlAttribute{
.name = std::string("name"),
Expand Down

0 comments on commit ca224fc

Please sign in to comment.