]> git.saurik.com Git - wxWidgets.git/commitdiff
fixing utf32 native conversion
authorStefan Csomor <csomor@advancedconcepts.ch>
Sun, 1 Feb 2009 09:08:02 +0000 (09:08 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sun, 1 Feb 2009 09:08:02 +0000 (09:08 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58586 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/osx/core/cfstring.h
src/osx/core/cfstring.cpp

index 2cd04a9d7622b3d3a6eb280e8f23a677a889f55e..1368aeb0b63400c888fcdb166087f7839f2d16d9 100644 (file)
 #include "wx/fontenc.h"
 #include "wx/osx/core/cfref.h"
 
+#if WORDS_BIGENDIAN
+    #define kCFStringEncodingUTF32Native kCFStringEncodingUTF32BE
+#else
+    #define kCFStringEncodingUTF32Native kCFStringEncodingUTF32LE
+#endif
+
 class WXDLLIMPEXP_FWD_BASE wxString;
 
 WXDLLIMPEXP_BASE void wxMacConvertNewlines13To10( wxString *data ) ;
index 2b0bfbe82a68f7ec7883b1f8dbbb6e2f7bf7c653..a65c5cb361ad16c385ff0f9f34f01783bb353225 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <CoreFoundation/CoreFoundation.h>
 
+
 void wxMacConvertNewlines13To10( char * data )
 {
     char * buf = data ;
@@ -611,7 +612,7 @@ wxCFStringRef::wxCFStringRef( const wxString &st , wxFontEncoding WXUNUSED_IN_UN
 #if wxUSE_UNICODE_WCHAR
         // native = wchar_t 4 bytes for us
         reset( CFStringCreateWithBytes( kCFAllocatorDefault,
-            (const UInt8*)str.wc_str() , str.length()*4, kCFStringEncodingUTF32, false /* no BOM */ ) );
+            (const UInt8*)str.wc_str() , str.length()*4, kCFStringEncodingUTF32Native, false /* no BOM */ ) );
 #elif wxUSE_UNICODE_UTF8
         // native = utf8
         reset( CFStringCreateWithBytes( kCFAllocatorDefault,
@@ -638,7 +639,7 @@ wxString wxCFStringRef::AsString(wxFontEncoding WXUNUSED_IN_UNICODE(encoding))
     wxString result;    
 #if wxUSE_UNICODE
   #if wxUSE_UNICODE_WCHAR
-    cfencoding = kCFStringEncodingUTF32;
+    cfencoding = kCFStringEncodingUTF32Native;
   #elif wxUSE_UNICODE_UTF8
     cfencoding = kCFStringEncodingUTF8;
   #else