diff options
author | rowanbeentje <rowan@beent.je> | 2008-12-09 13:54:47 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2008-12-09 13:54:47 +0000 |
commit | b20568e9498db7725ea887caca63837bd4337f91 (patch) | |
tree | b9def4dbd268e4293d8257d555810ffbb31d8dff /TableDocument.m | |
parent | 566e04bf7f43a3c81ad7de0df5e3d1e1eec0bfb4 (diff) | |
download | sequelpro-b20568e9498db7725ea887caca63837bd4337f91.tar.gz sequelpro-b20568e9498db7725ea887caca63837bd4337f91.tar.bz2 sequelpro-b20568e9498db7725ea887caca63837bd4337f91.zip |
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.
Diffstat (limited to 'TableDocument.m')
-rw-r--r-- | TableDocument.m | 9 |
1 files changed, 1 insertions, 8 deletions
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 { |