diff --git a/include/ircd/js/string.h b/include/ircd/js/string.h index fd1705688..137a301be 100644 --- a/include/ircd/js/string.h +++ b/include/ircd/js/string.h @@ -59,6 +59,7 @@ struct string char16_t operator[](const size_t &at) const; operator std::string() const; + operator std::u16string() const; operator JS::Value() const; using root::root; @@ -288,6 +289,13 @@ const return native(this->get()); } +template +string::operator std::u16string() +const +{ + return locale::char16::conv(native(this->get())); +} + template char * string::c_str()