summaryrefslogtreecommitdiff
path: root/data/mobileterminal/cstring.diff
blob: ba9499b3433ac736dec957a10ed2c942f5fbd4b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
diff -r -ru mobileterminal-286/Log.m mobileterminal-286+iPhone/Log.m
--- mobileterminal-286/Log.m	2008-05-07 08:33:09.000000000 +0000
+++ mobileterminal-286+iPhone/Log.m	2008-05-07 08:16:51.000000000 +0000
@@ -21,7 +21,7 @@
 	aFileHandle = [NSFileHandle fileHandleForWritingAtPath:aFile];
 	[aFileHandle truncateFileAtOffset:[aFileHandle seekToEndOfFile]];
 	
-	[aFileHandle writeData:[[NSString stringWithFormat: @"%@\n", str] dataUsingEncoding:nil]];
+	[aFileHandle writeData:[[NSString stringWithFormat: @"%@\n", str] dataUsingEncoding:kCFStringEncodingUTF8]];
 }
 
 //_______________________________________________________________________________
diff -r -ru mobileterminal-286/MobileTerminal.m mobileterminal-286+iPhone/MobileTerminal.m
--- mobileterminal-286/MobileTerminal.m	2008-05-07 08:33:09.000000000 +0000
+++ mobileterminal-286+iPhone/MobileTerminal.m	2008-05-07 08:13:49.000000000 +0000
@@ -356,7 +356,7 @@
   }
   else
   {
-    [[self activeProcess] write:[input cString] length:[input length]];
+    [[self activeProcess] write:[input UTF8String] length:[input length]];
   }    
 }
 
diff -r -ru mobileterminal-286/PieView.m mobileterminal-286+iPhone/PieView.m
--- mobileterminal-286/PieView.m	2008-05-07 08:33:09.000000000 +0000
+++ mobileterminal-286+iPhone/PieView.m	2008-05-07 08:13:35.000000000 +0000
@@ -71,7 +71,7 @@
   float height = 14.0f;
 
   NSString *fontName = @"HelveticaBold";
-  CGContextSelectFont(context, [fontName cString], height, kCGEncodingMacRoman);
+  CGContextSelectFont(context, [fontName UTF8String], height, kCGEncodingMacRoman);
   CGFontRef font = CGContextGetFont(context);
 
   NSString * text = [self title];
diff -r -ru mobileterminal-286/PTYTextView.m mobileterminal-286+iPhone/PTYTextView.m
--- mobileterminal-286/PTYTextView.m	2008-05-07 08:33:09.000000000 +0000
+++ mobileterminal-286+iPhone/PTYTextView.m	2008-05-07 08:13:35.000000000 +0000
@@ -238,7 +238,7 @@
 	if (!fontRef) 
 	{		
 		TerminalConfig * config = [[[Settings sharedInstance] terminalConfigs] objectAtIndex:termid];
-		const char * font = [config.font cString];
+		const char * font = [config.font UTF8String];
     // First time through: cache the fontRef. This lookup is expensive.
 		fontSize = config.fontSize;
     CGContextSelectFont(context, font, floor(lineHeight), kCGEncodingMacRoman);
diff -r -ru mobileterminal-286/SubProcess.m mobileterminal-286+iPhone/SubProcess.m
--- mobileterminal-286/SubProcess.m	2008-05-07 08:33:09.000000000 +0000
+++ mobileterminal-286+iPhone/SubProcess.m	2008-05-07 08:13:35.000000000 +0000
@@ -140,7 +140,7 @@
   if (arg != nil && [arg length] > 0) 
   {    
     // A command line argument was passed to the program
-    const char* path = [arg cString];
+    const char* path = [arg UTF8String];
     struct stat st;
     if ((stat(path, &st) == 0) && ((st.st_mode & S_IFDIR) != 0)) // it's a path, issue a cd command
     {
@@ -150,7 +150,7 @@
     } 
     else // just print the command 
     {
-      write(fd, [arg cString], [arg length]);
+      write(fd, [arg UTF8String], [arg length]);
       write(fd, "\n", 1);
     }
   }
@@ -186,7 +186,7 @@
 {
   // HACK: Just pretend the message came from the child
   NSLog(message);
-  [delegate handleStreamOutput:[message cString] length:[message length] identifier:termid];
+  [delegate handleStreamOutput:[message UTF8String] length:[message length] identifier:termid];
 }
 
 - (void)setWidth:(int)width height:(int)height
diff -r -ru mobileterminal-286/Tools.m mobileterminal-286+iPhone/Tools.m
--- mobileterminal-286/Tools.m	2008-05-07 08:33:09.000000000 +0000
+++ mobileterminal-286+iPhone/Tools.m	2008-05-07 08:21:40.000000000 +0000
@@ -28,7 +29,7 @@
 BOOL writeImageToPNG (CGImageRef image, NSString * filePath) 
 {
   if (image == nil) { log(@"[ERROR] no image"); return NO; }
-  CFURLRef cfurl = CFURLCreateFromFileSystemRepresentation (NULL, (const UInt8 *)[filePath cString], [filePath length], 0);
+  CFURLRef cfurl = CFURLCreateFromFileSystemRepresentation (NULL, (const UInt8 *)[filePath UTF8String], [filePath length], 0);
   CGImageDestinationRef imageDest = CGImageDestinationCreateWithURL(cfurl, (CFStringRef)@"public.png", 1, nil);
   if (imageDest==nil) { log(@"[ERROR] no image destination"); return NO; }  
   CGImageDestinationAddImage(imageDest, image, nil);
diff -r -ru mobileterminal-286/VT100Terminal.m mobileterminal-286+iPhone/VT100Terminal.m
--- mobileterminal-286/VT100Terminal.m	2008-05-07 08:33:09.000000000 +0000
+++ mobileterminal-286+iPhone/VT100Terminal.m	2008-05-07 08:13:35.000000000 +0000
@@ -1226,12 +1226,12 @@
   static int issetup = 0;
   if (!issetup) { issetup = 1;
   // this crashes on non-Cydia systems when called multiple times  
-  setupterm((char *)[termType cString], fileno(stdout), &r);
+  setupterm((char *)[termType UTF8String], fileno(stdout), &r);
   }
 
   if (r!=1) 
   {
-    log(@"Terminal type %s is not defined (%d)", [termType cString], r);
+    log(@"Terminal type %s is not defined (%d)", [termType UTF8String], r);
     for(i = 0; i < TERMINFO_KEYS; i ++) 
     {
       if (key_strings[i]) free(key_strings[i]);