Fix [#25678]: (Ghost Cocoa) Fix character encoding translation for filenames (open...
authorDamien Plisson <damien.plisson@yahoo.fr>
Tue, 18 Jan 2011 20:53:20 +0000 (20:53 +0000)
committerDamien Plisson <damien.plisson@yahoo.fr>
Tue, 18 Jan 2011 20:53:20 +0000 (20:53 +0000)
intern/ghost/intern/GHOST_SystemCocoa.mm
intern/ghost/intern/GHOST_WindowCocoa.mm

index 08d83565e5c2fe59010b0139e4c958aaa53fd975..bf401138cf1c35585d0ac295bda2e9c7b9d9748b 100644 (file)
@@ -1356,7 +1356,7 @@ bool GHOST_SystemCocoa::handleOpenDocumentRequest(void *filepathStr)
 
        if (confirmOpen == NSAlertAlternateReturn)
        {
-               filenameTextSize = [filepath lengthOfBytesUsingEncoding:NSISOLatin1StringEncoding];
+               filenameTextSize = [filepath lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
                
                temp_buff = (char*) malloc(filenameTextSize+1); 
                
@@ -1364,7 +1364,7 @@ bool GHOST_SystemCocoa::handleOpenDocumentRequest(void *filepathStr)
                        return GHOST_kFailure;
                }
                
-               strncpy(temp_buff, [filepath cStringUsingEncoding:NSISOLatin1StringEncoding], filenameTextSize);
+               strncpy(temp_buff, [filepath cStringUsingEncoding:NSUTF8StringEncoding], filenameTextSize);
                
                temp_buff[filenameTextSize] = '\0';
 
index db08f238045675812bbb0643f4539b2047388eb3..8d28c9d5b17941ea2e21935cef34ca1e222f2ca2 100644 (file)
@@ -498,7 +498,7 @@ void GHOST_WindowCocoa::setTitle(const STR_String& title)
     GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::setTitle(): window invalid")
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 
-       NSString *windowTitle = [[NSString alloc] initWithCString:title encoding:NSISOLatin1StringEncoding];
+       NSString *windowTitle = [[NSString alloc] initWithCString:title encoding:NSUTF8StringEncoding];
        
        //Set associated file if applicable
        if (windowTitle && [windowTitle hasPrefix:@"Blender"])
@@ -517,7 +517,7 @@ void GHOST_WindowCocoa::setTitle(const STR_String& title)
                        [m_window setTitle:[associatedFileName lastPathComponent]];
 
                        //Blender used file open/save functions converte file names into legal URL ones
-                       associatedFileName = [associatedFileName stringByAddingPercentEscapesUsingEncoding:NSISOLatin1StringEncoding];
+                       associatedFileName = [associatedFileName stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
                        @try {
                                [m_window setRepresentedFilename:associatedFileName];
                        }