From 3957158ec9c9919ae724cd2245c8ee174fec4908 Mon Sep 17 00:00:00 2001 From: Julian Storer Date: Wed, 16 Mar 2011 18:58:19 +0000 Subject: [PATCH] String::charToString fix. --- juce_amalgamated.cpp | 2 +- src/text/juce_String.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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();