diff --git a/src/osgText/String.cpp b/src/osgText/String.cpp index fc181dc9e..18529998c 100644 --- a/src/osgText/String.cpp +++ b/src/osgText/String.cpp @@ -312,12 +312,19 @@ std::string String::createUTF8EncodedString() const utf8string+=(char)(0xc0 | (currentChar>>6)); utf8string+=(char)(0x80 | (currentChar & 0x3f)); } - else + else if (currentChar < 0x10000) { utf8string+=(char)(0xe0 | (currentChar>>12)); utf8string+=(char)(0x80 | ((currentChar>>6) & 0x3f)); utf8string+=(char)(0x80 | (currentChar & 0x3f)); } + else + { + utf8string+=(char)(0xf0 | (currentChar >> 18)); + utf8string+=(char)(0x80 | ((currentChar >> 12) & 0x3f)); + utf8string+=(char)(0x80 | ((currentChar >> 6) & 0x3f)); + utf8string+=(char)(0x80 | (currentChar & 0x3f)); + } } return utf8string; }