From 305a0f60579a8191c0645b4764e83231d26bde1c Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sun, 8 Feb 2004 09:52:19 +0000 Subject: [PATCH 1/1] unicode savvy conversions git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25605 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/filedlg.cpp | 17 +++++++++++++---- src/mac/filedlg.cpp | 17 +++++++++++++---- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/mac/carbon/filedlg.cpp b/src/mac/carbon/filedlg.cpp index 677a77151e..d003e602ab 100644 --- a/src/mac/carbon/filedlg.cpp +++ b/src/mac/carbon/filedlg.cpp @@ -322,10 +322,19 @@ pascal Boolean CrossPlatformFilterCallback ( { FSRef fsref ; memcpy( &fsref , *theItem->dataHandle , sizeof(FSRef) ) ; - wxString file ; - const short maxpath = 1024 ; - FSRefMakePath( &fsref , (UInt8*) file.GetWriteBuf(maxpath+1),maxpath) ; - file.UngetWriteBuf() ; + + + + CFURLRef fullURLRef; + fullURLRef = ::CFURLCreateFromFSRef(NULL, &fsref); +#ifdef __UNIX__ + CFURLPathStyle pathstyle = kCFURLPOSIXPathStyle; +#else + CFURLPathStyle pathstyle = kCFURLHFSPathStyle; +#endif + CFStringRef cfString = CFURLCopyFileSystemPath(fullURLRef, pathstyle); + wxString file = wxMacCFStringHolder(cfString).AsString(wxFont::GetDefaultEncoding()); + display = CheckFile( file , theInfo->fileAndFolder.fileInfo.finderInfo.fdType , data ) ; } #endif diff --git a/src/mac/filedlg.cpp b/src/mac/filedlg.cpp index 677a77151e..d003e602ab 100644 --- a/src/mac/filedlg.cpp +++ b/src/mac/filedlg.cpp @@ -322,10 +322,19 @@ pascal Boolean CrossPlatformFilterCallback ( { FSRef fsref ; memcpy( &fsref , *theItem->dataHandle , sizeof(FSRef) ) ; - wxString file ; - const short maxpath = 1024 ; - FSRefMakePath( &fsref , (UInt8*) file.GetWriteBuf(maxpath+1),maxpath) ; - file.UngetWriteBuf() ; + + + + CFURLRef fullURLRef; + fullURLRef = ::CFURLCreateFromFSRef(NULL, &fsref); +#ifdef __UNIX__ + CFURLPathStyle pathstyle = kCFURLPOSIXPathStyle; +#else + CFURLPathStyle pathstyle = kCFURLHFSPathStyle; +#endif + CFStringRef cfString = CFURLCopyFileSystemPath(fullURLRef, pathstyle); + wxString file = wxMacCFStringHolder(cfString).AsString(wxFont::GetDefaultEncoding()); + display = CheckFile( file , theInfo->fileAndFolder.fileInfo.finderInfo.fdType , data ) ; } #endif -- 2.45.2