diff options
author | rowanbeentje <rowan@beent.je> | 2010-08-25 23:58:52 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2010-08-25 23:58:52 +0000 |
commit | dc9d005f21b3e281294f61d4d8e49d0ad003e8fb (patch) | |
tree | 02ac106ff98341c4b87d420c5ec9c9c2f1acb130 /Source/SPCopyTable.m | |
parent | 47b27a6d2b5d3cd7fa7152d2679283e7fba3e82d (diff) | |
download | sequelpro-dc9d005f21b3e281294f61d4d8e49d0ad003e8fb.tar.gz sequelpro-dc9d005f21b3e281294f61d4d8e49d0ad003e8fb.tar.bz2 sequelpro-dc9d005f21b3e281294f61d4d8e49d0ad003e8fb.zip |
Encoding changes and improvements, particularly to increase compatibility with extended characters in MySQL identifiers (names of dbs/tables/cols):
- Move encoding queries and control into MCPKit, with newly cleaned-up methods, and switch a number of locations to using the new code.
- Use UTF8 connections for many identifier-based queries (selecting and listing databases, tables, stored procs, table information). This fixes selection and creation of table and database names containing extended characters, also fixing exceptions and errors.
- Improve UTF8 over Latin1 to correctly set the client character set encoding as well, fixing custom queries and edits; remove custom code in SPTableContent achieving the same thing in a single location.
- Fix database encoding detection routines
- Update localisable strings
Diffstat (limited to 'Source/SPCopyTable.m')
-rw-r--r-- | Source/SPCopyTable.m | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index b1b663a4..db8ce49d 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -295,7 +295,7 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; else if ([cellData isSPNotLoaded]) [result appendFormat:@"%@\t", NSLocalizedString(@"(not loaded)", @"value shown for hidden blob and text fields")]; else if ([cellData isKindOfClass:[NSData class]]) { - NSString *displayString = [[NSString alloc] initWithData:cellData encoding:connectionEncoding]; + NSString *displayString = [[NSString alloc] initWithData:cellData encoding:[mySQLConnection stringEncoding]]; if (!displayString) displayString = [[NSString alloc] initWithData:cellData encoding:NSASCIIStringEncoding]; if (displayString) { [result appendFormat:@"%@\t", displayString]; @@ -520,7 +520,7 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; NSUInteger rowIndex = [selectedRows firstIndex]; NSString *nullString = [prefs objectForKey:SPNullValue]; Class nsDataClass = [NSData class]; - NSStringEncoding connectionEncoding = [mySQLConnection encoding]; + NSStringEncoding connectionEncoding = [mySQLConnection stringEncoding]; while ( rowIndex != NSNotFound ) { for ( c = 0; c < numColumns; c++) { @@ -681,7 +681,7 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; // Otherwise, ensure the cell is represented as a short string if ([contentString isKindOfClass:[NSData class]]) { - contentString = [contentString shortStringRepresentationUsingEncoding:[mySQLConnection encoding]]; + contentString = [contentString shortStringRepresentationUsingEncoding:[mySQLConnection stringEncoding]]; } else if ([contentString length] > 500) { contentString = [contentString substringToIndex:500]; } |