Author: espectador
Date: Fri Mar 28 01:59:13 2014
New Revision: 37773

URL: http://svn.gna.org/viewcvs/gnustep?rev=37773&view=rev
Log:
Fix for user name on Windows.

Modified:
    apps/projectcenter/trunk/ChangeLog
    apps/projectcenter/trunk/Framework/PCFileCreator.m

Modified: apps/projectcenter/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/projectcenter/trunk/ChangeLog?rev=37773&r1=37772&r2=37773&view=diff
==============================================================================
--- apps/projectcenter/trunk/ChangeLog  (original)
+++ apps/projectcenter/trunk/ChangeLog  Fri Mar 28 01:59:13 2014
@@ -1,3 +1,8 @@
+2014-03-27 German Arias <[email protected]>
+
+       * Framework/PCFileCreator.m: Be sure to use an UTF8 string for the user
+       name on Windows.
+
 2014-03-08 German Arias <[email protected]>
 
        * Framework/PCFileManager.m (-isTextFile:): Rewrite this method to work

Modified: apps/projectcenter/trunk/Framework/PCFileCreator.m
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/projectcenter/trunk/Framework/PCFileCreator.m?rev=37773&r1=37772&r2=37773&view=diff
==============================================================================
--- apps/projectcenter/trunk/Framework/PCFileCreator.m  (original)
+++ apps/projectcenter/trunk/Framework/PCFileCreator.m  Fri Mar 28 01:59:13 2014
@@ -297,12 +297,26 @@
 
   while ((subRange = [file rangeOfString:@"$USERNAME$"]).length)
     {
+#ifdef WIN32
+      // Be sure to use an UTF8 string.
+      [file replaceCharactersInRange: subRange
+                         withString: [NSString stringWithCString:
+                                                 [NSUserName() UTF8String]]];
+#else
       [file replaceCharactersInRange:subRange withString:NSUserName()];
+#endif
     }
     
   while ((subRange = [file rangeOfString:@"$FULLUSERNAME$"]).length)
     {
+#ifdef WIN32
+      // Be sure to use an UTF8 string.
+      [file replaceCharactersInRange: subRange
+                         withString: [NSString stringWithCString:
+                                               [NSFullUserName() UTF8String]]];
+#else
       [file replaceCharactersInRange:subRange withString:NSFullUserName()];
+#endif
     }
 
   while ((subRange = [file rangeOfString:@"$PROJECTNAME$"]).length)


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

Reply via email to