diff --git a/src/string.hh b/src/string.hh index f86e0661..f93c04d3 100644 --- a/src/string.hh +++ b/src/string.hh @@ -24,6 +24,14 @@ public: String(const String& string) = default; String(String&& string) = default; explicit String(char content, CharCount count = 1) : m_content((size_t)(int)count, content) {} + explicit String(Codepoint cp, CharCount count = 1) + { + std::string str; + auto it = back_inserter(str); + utf8::dump(it, cp); + for (CharCount i = 0; i < count; ++i) + m_content += str; + } template String(Iterator begin, Iterator end) : m_content(begin, end) {}