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

@@ -2116,7 +2116,7 @@ public:
UniChar* szUniBuffer = (UniChar*) szUnConv;
#if SIZEOF_WCHAR_T == 4
wxMBConvUTF16BE converter ;
wxMBConvUTF16 converter ;
nBufSize = converter.WC2MB( NULL , szUnConv , 0 );
szUniBuffer = new UniChar[ (nBufSize / sizeof(UniChar)) + 1] ;
converter.WC2MB( (char*) szUniBuffer , szUnConv, nBufSize + sizeof(UniChar)) ;
@@ -2252,7 +2252,7 @@ public:
// we have to terminate here, because n might be larger for the trailing zero, and if UniChar
// is not properly terminated we get random characters at the end
ubuf[byteOutLen / sizeof( UniChar ) ] = 0 ;
wxMBConvUTF16BE converter ;
wxMBConvUTF16 converter ;
res = converter.MB2WC( (buf ? buf : tbuf) , (const char*)ubuf , n ) ;
free( ubuf ) ;
#else
@@ -2285,7 +2285,7 @@ public:
ByteCount byteBufferLen = n ;
UniChar* ubuf = NULL ;
#if SIZEOF_WCHAR_T == 4
wxMBConvUTF16BE converter ;
wxMBConvUTF16 converter ;
size_t unicharlen = converter.WC2MB( NULL , psz , 0 ) ;
byteInLen = unicharlen ;
ubuf = (UniChar*) malloc( byteInLen + 2 ) ;