X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eb087029329fab4b9d4d956b525eba752ee8d5e3..60372b0d54379701d62edf5595a7dc25c48330e1:/src/osx/core/strconv_cf.cpp diff --git a/src/osx/core/strconv_cf.cpp b/src/osx/core/strconv_cf.cpp index c77825c23a..f4bd30f334 100644 --- a/src/osx/core/strconv_cf.cpp +++ b/src/osx/core/strconv_cf.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/osx/corefoundation/strconv.cpp +// Name: src/osx/core/strconv_cf.cpp // Purpose: Unicode conversion classes // Author: David Elliott // Modified by: @@ -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 + 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