summaryrefslogtreecommitdiff
path: root/cpp/src/IceXML/StreamI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceXML/StreamI.cpp')
-rw-r--r--cpp/src/IceXML/StreamI.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/cpp/src/IceXML/StreamI.cpp b/cpp/src/IceXML/StreamI.cpp
index 4ae72e53b1c..715d249a820 100644
--- a/cpp/src/IceXML/StreamI.cpp
+++ b/cpp/src/IceXML/StreamI.cpp
@@ -18,6 +18,7 @@
#include <Ice/LocalException.h>
#include <Ice/ObjectFactory.h>
#include <IceUtil/InputUtil.h>
+#include <IceUtil/Unicode.h>
#include <IceXML/StreamI.h>
@@ -1010,7 +1011,18 @@ IceXML::StreamI::readString(const string& name)
{
throw ::Ice::MarshalException(__FILE__, __LINE__);
}
- value = toString(child->getNodeValue());
+
+ //
+ // Convert string to UTF-8. Do NOT use toString() here.
+ //
+ const XMLCh* ch = child->getNodeValue();
+ unsigned int len = ICE_XERCES_NS XMLString::stringLen(ch);
+ wstring ws;
+ for(unsigned int i = 0; i < len; ++i)
+ {
+ ws.push_back((wstring::value_type)ch[i]);
+ }
+ value = IceUtil::wstringToString(ws);
}
else
{