From 2ae47e3f2bcbe7ae0bcc4c889c7221bc8fc26bea Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 19 Jan 2000 23:01:57 +0000 Subject: [PATCH] fixed ReadString for wxUSE_UNICODE git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5527 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/datstrm.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/common/datstrm.cpp b/src/common/datstrm.cpp index 433c90472a..5c4fd46091 100644 --- a/src/common/datstrm.cpp +++ b/src/common/datstrm.cpp @@ -86,13 +86,21 @@ double wxDataInputStream::ReadDouble() wxString wxDataInputStream::ReadString() { - wxString s; size_t len; len = Read32(); +#if wxUSE_UNICODE + char *tmp = new char[len + 1]; + m_input->Read(tmp, len); + tmp[len] = 0; + wxString s(tmp); + delete[] tmp; +#else + wxString s; m_input->Read(s.GetWriteBuf(len), len); s.UngetWriteBuf(); +#endif return s; } -- 2.45.2