From 3f7454fd8c189783ea6b1b10c4623cf7f01ca8af Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 22 Apr 2010 16:08:26 +0000 Subject: [PATCH] From Farshid Lashkari, "I've attached a small fix so that osgDB::convertStringFromUTF8toCurrentCodePage actually performs the conversion onto the destination string." --- src/osgDB/ConvertUTF.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgDB/ConvertUTF.cpp b/src/osgDB/ConvertUTF.cpp index 4af1b3dd0..db9748c03 100644 --- a/src/osgDB/ConvertUTF.cpp +++ b/src/osgDB/ConvertUTF.cpp @@ -149,7 +149,7 @@ std::string convertStringFromUTF8toCurrentCodePage(const char* source, unsigned } std::string sDest(destLen, '\0'); - destLen = WideCharToMultiByte(CP_ACP, 0, utf16.c_str(), sourceLength, 0, 0, 0, 0); + destLen = WideCharToMultiByte(CP_ACP, 0, utf16.c_str(), sourceLength, &sDest[0], destLen, 0, 0); if (destLen <= 0) { osg::notify(osg::WARN) << "Cannot convert multi-byte string to UTF-8." << std::endl;