]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/core/strconv_cf.cpp
Compilation fixes for wx{X11,GTK1,Motif} after making ref data non copyable.
[wxWidgets.git] / src / osx / core / strconv_cf.cpp
index c77825c23ac77f56008b2239b8ba84e57901234e..5f37413386c2d40050c6f1adc991b07aaa9bd9e0 100644 (file)
@@ -90,6 +90,14 @@ WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf(wxFontEncoding encoding)
         if ( theString == NULL )
             return wxCONV_FAILED;
 
+        // Ensure that the string is in canonical composed form (NFC): this is
+        // important because Darwin uses decomposed form (NFD) for e.g. file
+        // names but we want to use NFC internally.
+        wxCFRef<CFMutableStringRef>
+            cfMutableString(CFStringCreateMutableCopy(NULL, 0, theString));
+        CFStringNormalize(cfMutableString, kCFStringNormalizationFormC);
+        theString = cfMutableString;
+
         /* NOTE: The string content includes the NULL element if the source string did
          * That means we have to do nothing special because the destination will have
          * the NULL element iff the source did and the NULL element will be included