[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34391] trunk/blender/intern/ghost/intern: Fix [#25678]: (Ghost Cocoa) Fix character encoding translation for filenames ( open & window title display)

Damien Plisson damien.plisson at yahoo.fr
Tue Jan 18 21:53:20 CET 2011


Revision: 34391
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34391
Author:   damien78
Date:     2011-01-18 20:53:20 +0000 (Tue, 18 Jan 2011)
Log Message:
-----------
Fix [#25678]: (Ghost Cocoa) Fix character encoding translation for filenames (open & window title display)

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm
    trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm

Modified: trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm	2011-01-18 15:02:58 UTC (rev 34390)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm	2011-01-18 20:53:20 UTC (rev 34391)
@@ -1356,7 +1356,7 @@
 
 	if (confirmOpen == NSAlertAlternateReturn)
 	{
-		filenameTextSize = [filepath lengthOfBytesUsingEncoding:NSISOLatin1StringEncoding];
+		filenameTextSize = [filepath lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
 		
 		temp_buff = (char*) malloc(filenameTextSize+1); 
 		
@@ -1364,7 +1364,7 @@
 			return GHOST_kFailure;
 		}
 		
-		strncpy(temp_buff, [filepath cStringUsingEncoding:NSISOLatin1StringEncoding], filenameTextSize);
+		strncpy(temp_buff, [filepath cStringUsingEncoding:NSUTF8StringEncoding], filenameTextSize);
 		
 		temp_buff[filenameTextSize] = '\0';
 

Modified: trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm	2011-01-18 15:02:58 UTC (rev 34390)
+++ trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm	2011-01-18 20:53:20 UTC (rev 34391)
@@ -498,7 +498,7 @@
     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 @@
 			[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];
 			}




More information about the Bf-blender-cvs mailing list