From: Vadim Zeitlin Date: Wed, 5 Apr 2006 16:17:58 +0000 (+0000) Subject: fixed NextChar() to read the entire character at once as before it stopped on the... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d7f73361b999778884506a6c7ce2a1548d53a094?hp=d36c9347ea16171bc2f855076d8b9b11801ec622 fixed NextChar() to read the entire character at once as before it stopped on the first byte for ASCII input encoded as UTF-32LE git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38577 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/txtstrm.cpp b/src/common/txtstrm.cpp index 1ac783c88f..cbc90a4dae 100644 --- a/src/common/txtstrm.cpp +++ b/src/common/txtstrm.cpp @@ -79,8 +79,8 @@ wxChar wxTextInputStream::NextChar() if(m_input.LastRead() <= 0) return wxEOT; - int retlen = (int) m_conv->MB2WC(wbuf, m_lastBytes, 2); // returns -1 for failure - if(retlen >= 0) // res == 0 could happen for '\0' char + if ( m_conv->ToWChar(wbuf, WXSIZEOF(wbuf), m_lastBytes, inlen + 1) + != wxCONV_FAILED ) return wbuf[0]; } // there should be no encoding which requires more than nine bytes for one character...