aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordmoagx <post@wickenrode.com>2013-03-11 01:52:05 +0000
committerdmoagx <post@wickenrode.com>2013-03-11 01:52:05 +0000
commitd70bd5befb27a72e1b9ab6e44692ad67b2f437b9 (patch)
tree8151835523b502d87f45ab73a223a89886a07d45
parent980abfd10ef5aebe29a7e2369b996b16e25a16af (diff)
downloadsequelpro-d70bd5befb27a72e1b9ab6e44692ad67b2f437b9.tar.gz
sequelpro-d70bd5befb27a72e1b9ab6e44692ad67b2f437b9.tar.bz2
sequelpro-d70bd5befb27a72e1b9ab6e44692ad67b2f437b9.zip
* When adding a database the servers default charset is now shown
-rw-r--r--Resources/English.lproj/Localizable.stringsbin241788 -> 242060 bytes
-rw-r--r--Source/SPDatabaseData.m9
-rw-r--r--Source/SPDatabaseDocument.m4
3 files changed, 10 insertions, 3 deletions
diff --git a/Resources/English.lproj/Localizable.strings b/Resources/English.lproj/Localizable.strings
index bb36428b..c60a8792 100644
--- a/Resources/English.lproj/Localizable.strings
+++ b/Resources/English.lproj/Localizable.strings
Binary files differ
diff --git a/Source/SPDatabaseData.m b/Source/SPDatabaseData.m
index 787f5e1e..f2ac6a85 100644
--- a/Source/SPDatabaseData.m
+++ b/Source/SPDatabaseData.m
@@ -260,8 +260,13 @@ NSInteger _sortStorageEngineEntry(NSDictionary *itemOne, NSDictionary *itemTwo,
}
/**
- * Returns all of the database's currently available character set encodings by querying
- * information_schema.character_sets.
+ * Returns all of the database's currently available character set encodings
+ * @return [{Charset: 'utf8',Description: 'UTF-8 Unicode', Default collation: 'utf8_general_ci',Maxlen: 3},...]
+ * The Array is never empty and never nil but results might be unreliable.
+ *
+ * On MySQL 5+ this will query information_schema.character_sets
+ * On MySQL 4.1+ this will query SHOW CHARACTER SET
+ * Else a hardcoded list will be returned
*/
- (NSArray *)getDatabaseCharacterSetEncodings
{
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 03c4d919..bf1221f9 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -760,7 +760,9 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase";
// Populate the database encoding popup button with a default menu item
[databaseEncodingButton removeAllItems];
- [databaseEncodingButton addItemWithTitle:@"Default"];
+ NSString *defaultCharset = [databaseDataInstance getServerDefaultCharacterSet];
+ NSString *defaultItemTitle = (defaultCharset)? [NSString stringWithFormat:NSLocalizedString(@"Default (%@)",@"Add Database Sheet : Charset : Use Server Default ($1 = Charset Name)"),defaultCharset] : NSLocalizedString(@"Default",@"Add Database Sheet : Charset : Use Server Default (unknown)");
+ [databaseEncodingButton addItemWithTitle:defaultItemTitle];
// Retrieve the server-supported encodings and add them to the menu
NSArray *encodings = [databaseDataInstance getDatabaseCharacterSetEncodings];