reverted the change of r56246 and keep the old behaviour of MB2WC/WC2MB; document it even more clearly and correct code using these functions incorrectly
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@56394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2252,8 +2252,10 @@ void wxMacMLTEControl::SetTXNData( const wxString& st, TXNOffset start, TXNOffse
|
||||
#else
|
||||
wxMBConvUTF16 converter ;
|
||||
ByteCount byteBufferLen = converter.WC2MB( NULL, st.wc_str(), 0 ) ;
|
||||
UniChar *unibuf = (UniChar*)malloc( byteBufferLen ) ;
|
||||
converter.WC2MB( (char*)unibuf, st.wc_str(), byteBufferLen ) ;
|
||||
wxASSERT_MSG( byteBufferLen != wxCONV_FAILED,
|
||||
_T("Conversion to UTF-16 unexpectedly failed") );
|
||||
UniChar *unibuf = (UniChar*)malloc( byteBufferLen + 2 ) ; // 2 for NUL in UTF-16
|
||||
converter.WC2MB( (char*)unibuf, st.wc_str(), byteBufferLen + 2 ) ;
|
||||
TXNSetData( m_txn, kTXNUnicodeTextData, (void*)unibuf, byteBufferLen, start, end ) ;
|
||||
free( unibuf ) ;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user