diff options
Diffstat (limited to 'core/string/ustring.cpp')
-rw-r--r-- | core/string/ustring.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 213578485e..d630e987ea 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -209,7 +209,6 @@ void CharString::copy_from(const char *p_cstr) { /* String */ /*************************************************************************/ -//TODO: move to TextServer //kind of poor should be rewritten properly String String::word_wrap(int p_chars_per_line) const { int from = 0; @@ -4796,7 +4795,7 @@ Vector<uint8_t> String::to_utf16_buffer() const { Char16String charstr = s->utf16(); Vector<uint8_t> retval; - size_t len = charstr.length() * 2; + size_t len = charstr.length() * sizeof(char16_t); retval.resize(len); uint8_t *w = retval.ptrw(); copymem(w, (const void *)charstr.ptr(), len); @@ -4811,7 +4810,7 @@ Vector<uint8_t> String::to_utf32_buffer() const { } Vector<uint8_t> retval; - size_t len = s->length() * 4; + size_t len = s->length() * sizeof(char32_t); retval.resize(len); uint8_t *w = retval.ptrw(); copymem(w, (const void *)s->ptr(), len); |