diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 019a7f771b..e9b9d9b484 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -11784,7 +11784,7 @@ String::String (const CharPointer_UTF32& start, const CharPointer_UTF32& end) : const String String::charToString (const juce_wchar character) { - String result (PreallocationBytes (sizeof (CharPointerType::CharType))); + String result (PreallocationBytes (CharPointerType::getBytesRequiredFor (character))); CharPointerType t (result.text); t.write (character); t.writeNull(); diff --git a/src/text/juce_String.cpp b/src/text/juce_String.cpp index a5f93fb47d..525ea04620 100644 --- a/src/text/juce_String.cpp +++ b/src/text/juce_String.cpp @@ -318,7 +318,7 @@ String::String (const CharPointer_UTF32& start, const CharPointer_UTF32& end) : const String String::charToString (const juce_wchar character) { - String result (PreallocationBytes (sizeof (CharPointerType::CharType))); + String result (PreallocationBytes (CharPointerType::getBytesRequiredFor (character))); CharPointerType t (result.text); t.write (character); t.writeNull();