diff --git a/core/html_builder.cpp b/core/html_builder.cpp
index cf4d343..44dc57d 100644
--- a/core/html_builder.cpp
+++ b/core/html_builder.cpp
@@ -58,6 +58,18 @@ HTMLTag *HTMLTag::rel_stylesheet() {
return this;
}
+HTMLTag *HTMLTag::charset(const std::string &val) {
+ attrib("charset", val);
+
+ return this;
+}
+
+HTMLTag *HTMLTag::charset_utf_8() {
+ attrib("charset", "utf-8");
+
+ return this;
+}
+
HTMLTag *HTMLTag::attrib(const std::string &attr, const std::string &val) {
result += " " + attr + "=\"" + val + "\"";
diff --git a/core/html_builder.h b/core/html_builder.h
index cb3ea5a..11286d0 100644
--- a/core/html_builder.h
+++ b/core/html_builder.h
@@ -24,6 +24,8 @@ public:
HTMLTag *type(const std::string &val);
HTMLTag *rel(const std::string &val);
HTMLTag *rel_stylesheet();
+ HTMLTag *charset(const std::string &val);
+ HTMLTag *charset_utf_8();
HTMLTag *attrib(const std::string &attr, const std::string &val);