diff --git a/common/ustr.cpp b/common/ustr.cpp index 15368c565f2..19471cd2b57 100644 --- a/common/ustr.cpp +++ b/common/ustr.cpp @@ -49,6 +49,13 @@ U32String::U32String(const String &str, Common::CodePage page) : BaseString() { + _storage[0] = c; + _storage[1] = 0; + + _size = (c == 0) ? 0 : 1; +} + U32String &U32String::operator=(const U32String &str) { assign(str); return *this; diff --git a/common/ustr.h b/common/ustr.h index ad7745f6cb4..50a8073516d 100644 --- a/common/ustr.h +++ b/common/ustr.h @@ -95,6 +95,9 @@ public: /** Construct a copy of the given string. */ U32String(const String &str, CodePage page = kUtf8); + /** Construct a string consisting of the given character. */ + explicit U32String(value_type c); + /** Assign a given string to this string. */ U32String &operator=(const U32String &str);