]> git.saurik.com Git - wxWidgets.git/commitdiff
common code for normalization
authorStefan Csomor <csomor@advancedconcepts.ch>
Sun, 1 Jul 2012 17:03:39 +0000 (17:03 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sun, 1 Jul 2012 17:03:39 +0000 (17:03 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71918 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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

index 66a86760da827ad661f9041c222ca3d7baa1ce4b..385527e75ec2695b4e053cb66dd9fe5c6ac85ed7 100644 (file)
@@ -71,6 +71,7 @@ public:
     wxString AsString( wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) const;
 
     static wxString AsString( CFStringRef ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
+    static wxString AsStringWithNormalizationFormC( CFStringRef ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
 #if wxOSX_USE_COCOA_OR_IPHONE
     static wxString AsString( NSString* ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
 #endif
index c3bfcce19bd815258effb9a86fc6b816b2c7054a..9182556e4c10c0307054338eb07bfc74eacd0cff 100644 (file)
@@ -632,6 +632,18 @@ wxCFStringRef::wxCFStringRef( const wxString &st , wxFontEncoding WXUNUSED_IN_UN
     }
 }
 
+wxString wxCFStringRef::AsStringWithNormalizationFormC( CFStringRef ref, wxFontEncoding encoding )
+{
+    if ( !ref )
+        return wxEmptyString ;
+
+    CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, ref);
+    CFStringNormalize(cfMutableString,kCFStringNormalizationFormC);
+    wxString str = wxCFStringRef::AsString(ref,encoding);
+    CFRelease(cfMutableString);
+    return str;
+}
+
 wxString wxCFStringRef::AsString( CFStringRef ref, wxFontEncoding WXUNUSED_IN_UNICODE(encoding) )
 {
     if ( !ref )