From dc9d005f21b3e281294f61d4d8e49d0ad003e8fb Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Wed, 25 Aug 2010 23:58:52 +0000 Subject: 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 --- Source/SPExportInitializer.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/SPExportInitializer.m') diff --git a/Source/SPExportInitializer.m b/Source/SPExportInitializer.m index cc9aa16e..a34f729b 100644 --- a/Source/SPExportInitializer.m +++ b/Source/SPExportInitializer.m @@ -269,8 +269,8 @@ [sqlExporter setSqlInsertDivider:[exportSQLInsertDividerPopUpButton indexOfSelectedItem]]; // Cache the current connection encoding then change it to UTF-8 to allow SQL dumps to work - sqlPreviousConnectionEncoding = [[NSString alloc] initWithString:[tableDocumentInstance connectionEncoding]]; - sqlPreviousConnectionEncodingViaLatin1 = [tableDocumentInstance connectionEncodingViaLatin1:nil]; + sqlPreviousConnectionEncoding = [[NSString alloc] initWithString:[connection encoding]]; + sqlPreviousConnectionEncodingViaLatin1 = [connection encodingUsesLatin1Transport]; [tableDocumentInstance setConnectionEncoding:@"utf8" reloadingViews:NO]; @@ -354,8 +354,8 @@ [dotExporter setDotDatabaseVersion:[tableDocumentInstance mySQLVersion]]; // Cache the current connection encoding then change it to UTF-8 to allow SQL dumps to work - sqlPreviousConnectionEncoding = [[NSString alloc] initWithString:[tableDocumentInstance connectionEncoding]]; - sqlPreviousConnectionEncodingViaLatin1 = [tableDocumentInstance connectionEncodingViaLatin1:nil]; + sqlPreviousConnectionEncoding = [[NSString alloc] initWithString:[connection encoding]]; + sqlPreviousConnectionEncodingViaLatin1 = [connection encodingUsesLatin1Transport]; [tableDocumentInstance setConnectionEncoding:@"utf8" reloadingViews:NO]; @@ -386,7 +386,7 @@ for (SPExporter *exporter in exporters) { [exporter setConnection:connection]; - [exporter setExportOutputEncoding:[connection encoding]]; + [exporter setExportOutputEncoding:[connection stringEncoding]]; [exporter setExportMaxProgress:(NSInteger)[exportProgressIndicator bounds].size.width]; [exporter setExportUsingLowMemoryBlockingStreaming:[exportProcessLowMemoryButton state]]; [exporter setExportOutputCompressionFormat:[exportOutputCompressionFormatPopupButton indexOfSelectedItem]]; -- cgit v1.2.3