making sure mac filenames are always decomposed D Unicode UTF8 and the internal wxStrings are using composed D Unicode

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39905 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2006-06-30 14:24:14 +00:00
parent 033ab32e66
commit 739cb14a31
2 changed files with 144 additions and 18 deletions

View File

@@ -881,13 +881,19 @@ wxString wxMacFSRefToPath( const FSRef *fsRef , CFStringRef additionalPathCompon
}
CFStringRef cfString = CFURLCopyFileSystemPath(fullURLRef, kDefaultPathStyle);
CFRelease( fullURLRef ) ;
return wxMacCFStringHolder(cfString).AsString(wxLocale::GetSystemEncoding());
CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, cfString);
CFRelease( cfString );
CFStringNormalize(cfMutableString,kCFStringNormalizationFormC);
return wxMacCFStringHolder(cfMutableString).AsString(wxLocale::GetSystemEncoding());
}
OSStatus wxMacPathToFSRef( const wxString&path , FSRef *fsRef )
{
OSStatus err = noErr ;
CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, wxMacCFStringHolder(path ,wxLocale::GetSystemEncoding() ) , kDefaultPathStyle, false);
CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, wxMacCFStringHolder(path ,wxLocale::GetSystemEncoding() ) ) ;
CFStringNormalize(cfMutableString,kCFStringNormalizationFormD);
CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, cfMutableString , kDefaultPathStyle, false);
CFRelease( cfMutableString );
if ( NULL != url )
{
if ( CFURLGetFSRef(url, fsRef) == false )
@@ -906,7 +912,10 @@ wxString wxMacHFSUniStrToString( ConstHFSUniStr255Param uniname )
CFStringRef cfname = CFStringCreateWithCharacters( kCFAllocatorDefault,
uniname->unicode,
uniname->length );
return wxMacCFStringHolder(cfname).AsString() ;
CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, cfname);
CFRelease( cfname );
CFStringNormalize(cfMutableString,kCFStringNormalizationFormC);
return wxMacCFStringHolder(cfMutableString).AsString() ;
}
wxString wxMacFSSpec2MacFilename( const FSSpec *spec )