Author: espectador
Date: Thu Apr  3 02:56:52 2014
New Revision: 37784

URL: http://svn.gna.org/viewcvs/gnustep?rev=37784&view=rev
Log:
Fix problem with coding on Windows.

Modified:
    apps/projectcenter/trunk/ChangeLog
    apps/projectcenter/trunk/Framework/PCFileCreator.m
    apps/projectcenter/trunk/Modules/Editors/ProjectCenter/PCEditorView.m

Modified: apps/projectcenter/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/projectcenter/trunk/ChangeLog?rev=37784&r1=37783&r2=37784&view=diff
==============================================================================
--- apps/projectcenter/trunk/ChangeLog  (original)
+++ apps/projectcenter/trunk/ChangeLog  Thu Apr  3 02:56:52 2014
@@ -1,3 +1,10 @@
+2014-04-02 German Arias <[email protected]>
+
+       * Framework/PCFileCreator.m (-replaceTagsInFileAtPath:withProject:):
+       Ensure UTF-8 when read and write a file in Windows.
+       * Modules/Editors/ProjectCenter/PCEditorView.m (-insertText:): Ensure
+       UTF-8 when insert a text in Windows.
+
 2014-04-02 German Arias <[email protected]>
 
        * Framework/English.lproj/SaveModified.gorm: Use class PCAuxiliaryWindow

Modified: apps/projectcenter/trunk/Framework/PCFileCreator.m
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/projectcenter/trunk/Framework/PCFileCreator.m?rev=37784&r1=37783&r2=37784&view=diff
==============================================================================
--- apps/projectcenter/trunk/Framework/PCFileCreator.m  (original)
+++ apps/projectcenter/trunk/Framework/PCFileCreator.m  Thu Apr  3 02:56:52 2014
@@ -278,7 +278,13 @@
   NSString *fn = [aFile stringByDeletingPathExtension];
   NSRange  subRange;
 
+#ifdef WIN32    
+  file = [[NSMutableString stringWithContentsOfFile: newFile    
+                                          encoding: NSUTF8StringEncoding       
 
+                                             error: NULL] retain];      
+#else
   file = [[NSMutableString stringWithContentsOfFile:newFile] retain];
+#endif
 
   while ((subRange = [file rangeOfString:@"$FULLFILENAME$"]).length)
     {
@@ -321,8 +327,14 @@
        withString:[[NSNumber numberWithInt:year] stringValue]];
     }
 
+#ifdef WIN32    
+  [file writeToFile: newFile    
+        atomically: YES         
+          encoding: NSUTF8StringEncoding        
+             error: NULL];      
+#else
   [file writeToFile:newFile atomically:YES];
-
+#endif
 
   [file release];
 }

Modified: apps/projectcenter/trunk/Modules/Editors/ProjectCenter/PCEditorView.m
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/projectcenter/trunk/Modules/Editors/ProjectCenter/PCEditorView.m?rev=37784&r1=37783&r2=37784&view=diff
==============================================================================
--- apps/projectcenter/trunk/Modules/Editors/ProjectCenter/PCEditorView.m       
(original)
+++ apps/projectcenter/trunk/Modules/Editors/ProjectCenter/PCEditorView.m       
Thu Apr  3 02:56:52 2014
@@ -519,7 +519,12 @@
               memset(&buf[1], ' ', offset);
               buf[offset+1] = '\0';
 
-              [super insertText:[NSString stringWithCString:buf]];
+#ifdef WIN32
+              [super insertText:[NSString stringWithCString: buf
+                                         encoding: NSUTF8StringEncoding]];
+#else
+             [super insertText:[NSString stringWithCString:buf]];
+#endif
               free(buf);
 /*            }
           else
@@ -558,12 +563,20 @@
         }
       else
         {
+#ifdef WIN32
+         [super insertText: [NSString stringWithCString: [text UTF8String]]];
+#else
           [super insertText: text];
+#endif
         }
     }
   else
     {
+#ifdef WIN32
+      [super insertText: [NSString stringWithCString: [text UTF8String]]];
+#else
       [super insertText: text];
+#endif
     }
 }
 


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to