+ 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;