aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMMCPConnection.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-06-18 14:03:02 +0000
committerBibiko <bibiko@eva.mpg.de>2009-06-18 14:03:02 +0000
commitc040e154bc58fac262324a0c40ef5572d5ef28c8 (patch)
tree700162d14e8f27601c21eb3014f67e8df2a20b06 /Source/CMMCPConnection.m
parent189886df88e04296555743b15ba31d2fee887e22 (diff)
downloadsequelpro-c040e154bc58fac262324a0c40ef5572d5ef28c8.tar.gz
sequelpro-c040e154bc58fac262324a0c40ef5572d5ef28c8.tar.bz2
sequelpro-c040e154bc58fac262324a0c40ef5572d5ef28c8.zip
• introduced inline function NSStringUTF8String() to SPStringAdditions.h
- NSData *d = [aStr UTF8String]; :== NSData *d = NSStrignUTF8String(aStr) but a tick faster • implemented NSStringUTF8String() in queryString: and for the lex parser (syntax highlighting)
Diffstat (limited to 'Source/CMMCPConnection.m')
-rw-r--r--Source/CMMCPConnection.m10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/CMMCPConnection.m b/Source/CMMCPConnection.m
index bf3eac18..4cc2fccf 100644
--- a/Source/CMMCPConnection.m
+++ b/Source/CMMCPConnection.m
@@ -24,6 +24,7 @@
// More info at <http://code.google.com/p/sequel-pro/>
#import "CMMCPConnection.h"
+#import "SPStringAdditions.h"
#include <unistd.h>
#include <setjmp.h>
@@ -140,6 +141,7 @@ static void forcePingTimeout(int signalNumber);
}
cStringPtr = [self methodForSelector:@selector(cStringFromString:usingEncoding:)];
+
}
/*
@@ -446,7 +448,7 @@ static void forcePingTimeout(int signalNumber);
[self queryString:[NSString stringWithFormat:@"/*!40101 SET NAMES '%@' */", currentEncoding]];
[self setEncoding:[CMMCPConnection encodingForMySQLEncoding:[currentEncoding UTF8String]]];
if (currentEncodingUsesLatin1Transport) {
- [self queryString:@"/*!40101 SET CHARACTER_SET_RESULTS=latin1 */"];
+ [self queryString:@"/*!40101 SET CHARACTER_SET_RESULTS=latin1 */"];
}
}
} else if (parentWindow) {
@@ -750,10 +752,10 @@ static void forcePingTimeout(int signalNumber);
// Derive the query string in the correct encoding
switch(encoding) {
case NSUTF8StringEncoding:
- theCQuery = [query UTF8String];
- break;
+ theCQuery = NSStringUTF8String(query);
+ break;
default:
- theCQuery = (const char*)(NSString*)(int)(*cStringPtr)(self, @selector(cStringFromString:), query, encoding);
+ theCQuery = (const char*)(NSString*)(int)(*cStringPtr)(self, @selector(cStringFromString:), query, encoding);
//[self cStringFromString:query usingEncoding:encoding];
}