OSX uses NFKD but this is unexpected for wx applications, so normalize the
string to use the composed form whenever we receive a file system path from OS
X.
Closes #13504.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72895
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
if (returnCode == NSOKButton )
{
NSOpenPanel* oPanel = (NSOpenPanel*)panel;
- SetPath( wxCFStringRef::AsString([[oPanel filenames] objectAtIndex:0]));
+ SetPath( wxCFStringRef::AsStringWithNormalizationFormC([[oPanel filenames] objectAtIndex:0]));
result = wxID_OK;
}
SetReturnCode(result);
NSSavePanel* sPanel = (NSSavePanel*)panel;
result = wxID_OK;
- m_path = wxCFStringRef::AsString([sPanel filename]);
+ m_path = wxCFStringRef::AsStringWithNormalizationFormC([sPanel filename]);
m_fileName = wxFileNameFromPath(m_path);
m_dir = wxPathOnly( m_path );
if (m_filterChoice)
NSArray* filenames = [oPanel filenames];
for ( size_t i = 0 ; i < [filenames count] ; ++ i )
{
- wxString fnstr = wxCFStringRef::AsString([filenames objectAtIndex:i]);
+ wxString fnstr = wxCFStringRef::AsStringWithNormalizationFormC([filenames objectAtIndex:i]);
m_paths.Add( fnstr );
m_fileNames.Add( wxFileNameFromPath(fnstr) );
if ( i == 0 )
const size_t count = [fileNames count];
for (i = 0; i < count; i++)
{
- fileList.Add( wxCFStringRef::AsString([fileNames objectAtIndex:i]) );
+ fileList.Add( wxCFStringRef::AsStringWithNormalizationFormC([fileNames objectAtIndex:i]) );
}
wxTheApp->MacOpenFiles(fileList);
wxCHECK_MSG(absoluteURL, wxEmptyString, wxT("Failed to resolve relative URL to absolute URL"));
CFStringRef cfStrPath = CFURLCopyFileSystemPath(absoluteURL,kDefaultPathStyle);
CFRelease(absoluteURL);
- return wxCFStringRef(cfStrPath).AsString(wxLocale::GetSystemEncoding());
+ return wxCFStringRef::AsStringWithNormalizationFormC(cfStrPath);
}
wxString wxStandardPathsCF::GetFromFunc(wxCFURLRef (*func)(wxCFBundleRef)) const