]> git.saurik.com Git - wxWidgets.git/commitdiff
use wxMBConvStrictUTF8 instead of wxMBConvUTF8 in ConvertStr() and mb/wc_str()
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 24 Jul 2007 15:10:21 +0000 (15:10 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 24 Jul 2007 15:10:21 +0000 (15:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/string.cpp

index 87e5613472f80e930a0d65fdf4fa86affb154e79..d36f85bd5a2cb4259e40df65fdd87a9cc3bfb7f8 100644 (file)
@@ -340,7 +340,7 @@ wxString::SubstrBufFromMB wxString::ConvertStr(const char *psz, size_t nLength,
         return SubstrBufFromMB("", 0);
 
     // and then to UTF-8:
         return SubstrBufFromMB("", 0);
 
     // and then to UTF-8:
-    SubstrBufFromMB buf(ConvertStr(wcBuf, wcLen, wxMBConvUTF8()));
+    SubstrBufFromMB buf(ConvertStr(wcBuf, wcLen, wxMBConvStrictUTF8()));
     // widechar -> UTF-8 conversion isn't supposed to ever fail:
     wxASSERT_MSG( buf.data, _T("conversion to UTF-8 failed") );
 
     // widechar -> UTF-8 conversion isn't supposed to ever fail:
     wxASSERT_MSG( buf.data, _T("conversion to UTF-8 failed") );
 
@@ -382,9 +382,12 @@ const wxCharBuffer wxString::mb_str(const wxMBConv& conv) const
 
 const wxWCharBuffer wxString::wc_str() const
 {
 
 const wxWCharBuffer wxString::wc_str() const
 {
-    return wxMBConvUTF8().cMB2WC(m_impl.c_str(),
-                                 m_impl.length() + 1 /* size, not length */,
-                                 NULL);
+    return wxMBConvStrictUTF8().cMB2WC
+                                (
+                                    m_impl.c_str(),
+                                    m_impl.length() + 1, // size, not length
+                                    NULL
+                                );
 }
 
 const wxCharBuffer wxString::mb_str(const wxMBConv& conv) const
 }
 
 const wxCharBuffer wxString::mb_str(const wxMBConv& conv) const
@@ -395,10 +398,12 @@ const wxCharBuffer wxString::mb_str(const wxMBConv& conv) const
     // FIXME-UTF8: use wc_str() here once we have buffers with length
 
     size_t wcLen;
     // FIXME-UTF8: use wc_str() here once we have buffers with length
 
     size_t wcLen;
-    wxWCharBuffer wcBuf(
-            wxMBConvUTF8().cMB2WC(m_impl.c_str(),
-                                  m_impl.length() + 1 /* size, not length */,
-                                  &wcLen));
+    wxWCharBuffer wcBuf(wxMBConvStrictUTF8().cMB2WC
+                                             (
+                                                m_impl.c_str(),
+                                                m_impl.length() + 1, // size
+                                                &wcLen
+                                             ));
     if ( !wcLen )
         return wxCharBuffer("");
 
     if ( !wcLen )
         return wxCharBuffer("");