]> git.saurik.com Git - wxWidgets.git/commitdiff
UniChar being platform endian
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 8 Jun 2005 23:34:05 +0000 (23:34 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 8 Jun 2005 23:34:05 +0000 (23:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34606 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/dobjcmn.cpp
src/common/strconv.cpp
src/mac/carbon/dc.cpp
src/mac/carbon/dccg.cpp
src/mac/carbon/textctrl.cpp
src/mac/carbon/toplevel.cpp
src/mac/corefoundation/cfstring.cpp

index ac306c2d902c1381e2f75ec45e81767720d4aa61..a37ffa50e625d0deeb42b22c3bd3e407270d85c3 100644 (file)
@@ -281,7 +281,7 @@ size_t wxTextDataObject::GetDataSize(const wxDataFormat& format) const
     if (format == wxDF_UNICODETEXT)
     {
         // host native is UTF16
-        wxMBConvUTF16BE converter ;
+        wxMBConvUTF16 converter ;
         return converter.WC2MB( NULL , GetText().c_str() , 0 ) + 2; // add space for trailing unichar 0
     }
     else  // == wxDF_TEXT
@@ -296,7 +296,7 @@ bool wxTextDataObject::GetDataHere(const wxDataFormat& format, void *buf) const
     if (format == wxDF_UNICODETEXT)
     {
         // host native is UTF16
-        wxMBConvUTF16BE converter ;
+        wxMBConvUTF16 converter ;
         size_t len = converter.WC2MB( NULL , GetText().c_str() , 0 ) ;
         wxCharBuffer buffer = converter.cWX2MB( GetText().c_str() );
         memcpy( (char*) buf, (const char*) buffer , len + 2); // trailing unichar 0
@@ -316,7 +316,7 @@ bool wxTextDataObject::SetData(const wxDataFormat& format,
     if (format == wxDF_UNICODETEXT)
     {
         // host native is UTF16
-        wxMBConvUTF16BE converter ;
+        wxMBConvUTF16 converter ;
         SetText( converter.cMB2WX( (const char*) buf ) );
     }
     else
index 45af589a8bb698ffd1efbf53a03db0b0e8a9cabe..aea1e1a18af397c745fed35b26afb06974b988e3 100644 (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 ) ;
index e3439b8aec662bfeb53d58f646af522cb9c62b7c..31ace9896acad75b51a4d375fdc0ddc9c6cd2e6c 100644 (file)
@@ -1315,7 +1315,7 @@ void  wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
     UniCharCount chars = str.Length() ;
     UniChar* ubuf = NULL ;
 #if SIZEOF_WCHAR_T == 4
-    wxMBConvUTF16BE converter ;
+    wxMBConvUTF16 converter ;
 #if wxUSE_UNICODE
     size_t unicharlen = converter.WC2MB( NULL , str.wc_str() , 0 ) ;
     ubuf = (UniChar*) malloc( unicharlen + 2 ) ;
index 7253d6d835650118781eae1b0e896456a63239bf..c5ed4a9bae8784b147c3c356935f04d1b1e68955 100755 (executable)
@@ -1294,7 +1294,7 @@ void  wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
     UniCharCount chars = str.Length() ;
     UniChar* ubuf = NULL ;
 #if SIZEOF_WCHAR_T == 4
-       wxMBConvUTF16BE converter ;
+       wxMBConvUTF16 converter ;
 #if wxUSE_UNICODE
        size_t unicharlen = converter.WC2MB( NULL , str.wc_str() , 0 ) ;
        ubuf = (UniChar*) malloc( unicharlen + 2 ) ;
@@ -1454,7 +1454,7 @@ void  wxDC::DoGetTextExtent( const wxString &str, wxCoord *width, wxCoord *heigh
     UniCharCount chars = str.Length() ;
     UniChar* ubuf = NULL ;
 #if SIZEOF_WCHAR_T == 4
-       wxMBConvUTF16BE converter ;
+       wxMBConvUTF16 converter ;
 #if wxUSE_UNICODE
        size_t unicharlen = converter.WC2MB( NULL , str.wc_str() , 0 ) ;
        ubuf = (UniChar*) malloc( unicharlen + 2 ) ;
@@ -1526,7 +1526,7 @@ bool wxDC::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) con
     UniCharCount chars = text.Length() ;
     UniChar* ubuf = NULL ;
 #if SIZEOF_WCHAR_T == 4
-    wxMBConvUTF16BE converter ;
+    wxMBConvUTF16 converter ;
 #if wxUSE_UNICODE
     size_t unicharlen = converter.WC2MB( NULL , text.wc_str() , 0 ) ;
     ubuf = (UniChar*) malloc( unicharlen + 2 ) ;
index e41e0e2c8ef75e119aa2d956ee8527478e73ba52..6980cdc9f3aa65a65cd54820c6e4f3347b02a239 100644 (file)
@@ -1424,7 +1424,7 @@ wxString wxMacMLTEControl::GetStringValue() const
                 SetHandleSize( theText , ( actualSize + 1 ) * sizeof( UniChar ) ) ;
                 HLock( theText ) ;
                 (((UniChar*)*theText)[actualSize]) = 0 ;
-                wxMBConvUTF16BE converter ;
+                wxMBConvUTF16 converter ;
                 size_t noChars = converter.MB2WC( NULL , (const char*)*theText , 0 ) ;
                 ptr = new wxChar[noChars + 1] ;
 
@@ -1896,7 +1896,7 @@ void wxMacMLTEControl::SetTXNData( const wxString& st , TXNOffset start , TXNOff
     TXNSetData( m_txn , kTXNUnicodeTextData,  (void*)st.wc_str(), len * 2,
       start, end);
 #else
-    wxMBConvUTF16BE converter ;
+    wxMBConvUTF16 converter ;
     ByteCount byteBufferLen = converter.WC2MB( NULL , st.wc_str() , 0 ) ;
     UniChar *unibuf = (UniChar*) malloc(byteBufferLen) ;
     converter.WC2MB( (char*) unibuf , st.wc_str() , byteBufferLen ) ;
index 5a047b14de59bf84d9944bfa3a82f47481984ef7..f1308198d4cbb2f03c6d3c76bc5f6a191144451a 100644 (file)
@@ -188,7 +188,7 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event
 #if SIZEOF_WCHAR_T == 2
         uniChar = charBuf[0] ;
 #else
-        wxMBConvUTF16BE converter ;
+        wxMBConvUTF16 converter ;
         converter.MB2WC( &uniChar , (const char*)charBuf , 1 ) ;
 #endif
         if ( dataSize > 4 )
index ace47930f9556462770038d9fb6b7fefbc4d818b..11b0f6d4ffd5874751a057f1c72390187bd78d81 100644 (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 ) ;