]> git.saurik.com Git - wxWidgets.git/commitdiff
unicode savvy conversions
authorStefan Csomor <csomor@advancedconcepts.ch>
Sun, 8 Feb 2004 09:52:19 +0000 (09:52 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sun, 8 Feb 2004 09:52:19 +0000 (09:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25605 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/filedlg.cpp
src/mac/filedlg.cpp

index 677a77151e0fa87a4ce416d22a65f2cb6cd38e1a..d003e602ab94a0ddabc14e81f1222103ad50c089 100644 (file)
@@ -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
index 677a77151e0fa87a4ce416d22a65f2cb6cd38e1a..d003e602ab94a0ddabc14e81f1222103ad50c089 100644 (file)
@@ -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