[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28916] trunk/blender/intern/ghost/intern/ GHOST_SystemCocoa.mm: Fix [#22306]: convert dropped file names from OSX to correct char encoding to handle non 7-bit ascii chars (e.g.

Damien Plisson damien.plisson at yahoo.fr
Sat May 22 09:32:57 CEST 2010


Revision: 28916
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28916
Author:   damien78
Date:     2010-05-22 09:32:55 +0200 (Sat, 22 May 2010)

Log Message:
-----------
Fix [#22306]: convert dropped file names from OSX to correct char encoding to handle non 7-bit ascii chars (e.g. accents)

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

Modified: trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm	2010-05-22 04:54:34 UTC (rev 28915)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm	2010-05-22 07:32:55 UTC (rev 28916)
@@ -1106,7 +1106,7 @@
 					{
 						droppedStr = [droppedArray objectAtIndex:i];
 						
-						pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSISOLatin1StringEncoding];
+						pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
 						temp_buff = (GHOST_TUns8*) malloc(pastedTextSize+1); 
 					
 						if (!temp_buff) {
@@ -1114,7 +1114,7 @@
 							break;
 						}
 					
-						strncpy((char*)temp_buff, [droppedStr cStringUsingEncoding:NSISOLatin1StringEncoding], pastedTextSize);
+						strncpy((char*)temp_buff, [droppedStr cStringUsingEncoding:NSUTF8StringEncoding], pastedTextSize);
 						temp_buff[pastedTextSize] = '\0';
 						
 						strArray->strings[i] = temp_buff;
@@ -1125,7 +1125,7 @@
 					
 				case GHOST_kDragnDropTypeString:
 					droppedStr = (NSString*)data;
-					pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSISOLatin1StringEncoding];
+					pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
 					
 					temp_buff = (GHOST_TUns8*) malloc(pastedTextSize+1); 
 					
@@ -1133,7 +1133,7 @@
 						return GHOST_kFailure;
 					}
 					
-					strncpy((char*)temp_buff, [droppedStr cStringUsingEncoding:NSISOLatin1StringEncoding], pastedTextSize);
+					strncpy((char*)temp_buff, [droppedStr cStringUsingEncoding:NSUTF8StringEncoding], pastedTextSize);
 					
 					temp_buff[pastedTextSize] = '\0';
 					





More information about the Bf-blender-cvs mailing list