UniChar being platform endian

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34606 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2005-06-08 23:34:05 +00:00
parent 48e8e90e91
commit d9d488cf1b
7 changed files with 15 additions and 15 deletions

View File

@@ -648,7 +648,7 @@ void wxMacCFStringHolder::Assign( const wxString &st , wxFontEncoding encoding )
m_cfs = CFStringCreateWithCharacters( kCFAllocatorDefault,
(UniChar*)str.wc_str() , str.Len() );
#else
wxMBConvUTF16BE converter ;
wxMBConvUTF16 converter ;
size_t unicharlen = converter.WC2MB( NULL , str.wc_str() , 0 ) ;
UniChar *unibuf = new UniChar[ unicharlen / sizeof(UniChar) + 1 ] ;
converter.WC2MB( (char*)unibuf , str.wc_str() , unicharlen ) ;
@@ -679,7 +679,7 @@ wxString wxMacCFStringHolder::AsString(wxFontEncoding encoding)
UniChar* unibuf = new UniChar[ cflen + 1 ] ;
CFStringGetCharacters( m_cfs , CFRangeMake( 0 , cflen ) , (UniChar*) unibuf ) ;
unibuf[cflen] = 0 ;
wxMBConvUTF16BE converter ;
wxMBConvUTF16 converter ;
noChars = converter.MB2WC( NULL , (const char*)unibuf , 0 ) ;
buf = new wxChar[ noChars + 1 ] ;
converter.MB2WC( buf , (const char*)unibuf , noChars ) ;