From b20568e9498db7725ea887caca63837bd4337f91 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Tue, 9 Dec 2008 13:54:47 +0000 Subject: Slight tweak to per-table encoding autodetection following testing and quick chat with Stuart - now calls [TableDocument setEncoding:] so that all encoding setting is handled in one place. This fixes a bug where table encoding was detected correctly but only partly used, and adds error detection by falling back to connection autodetection if encoding change fails. --- TableDocument.m | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'TableDocument.m') diff --git a/TableDocument.m b/TableDocument.m index 8ca7b0ae..2dcb5f1a 100644 --- a/TableDocument.m +++ b/TableDocument.m @@ -784,14 +784,7 @@ NSString *TableDocumentFavoritesControllerFavoritesDidChange = @"TableDocumentFa if ([encodingComponents count] > 0) { NSString *tableEncoding = [encodingComponents objectAtIndex:0]; - [mySQLConnection setEncoding:[CMMCPConnection encodingForMySQLEncoding:[tableEncoding UTF8String]]]; - - // Save the encoding - [_encoding autorelease]; - _encoding = [tableEncoding retain]; - - // update the selected menu item - [self updateEncodingMenuWithSelectedEncoding:[self encodingNameFromMySQLEncoding:tableEncoding]]; + [self setEncoding:tableEncoding]; } } else { -- cgit v1.2.3