aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2015-02-01 20:51:54 +0100
committerMax <post@wickenrode.com>2015-02-01 20:51:54 +0100
commit24fcf917473862ddabc2095447f3ec5c4e9081fd (patch)
tree368a00269d935589059ad3d5246afa86b5203853
parent60a5d64518f09af80059e2e293849ff6b0d6be75 (diff)
downloadsequelpro-24fcf917473862ddabc2095447f3ec5c4e9081fd.tar.gz
sequelpro-24fcf917473862ddabc2095447f3ec5c4e9081fd.tar.bz2
sequelpro-24fcf917473862ddabc2095447f3ec5c4e9081fd.zip
Rename utf8 and utf8mb4
* To reduce confusion (and create some, for those people not yet aware of the difference) I have renamed the utf8s to "UTF-8 Unicode BMP" resp. "UTF-8 Full Unicode" according to their supported character range. * Also *both* utf8 variants will now be at the top of the list when creating new tables/databases
-rw-r--r--Interfaces/English.lproj/MainMenu.xib4
-rw-r--r--Interfaces/English.lproj/Preferences.xib4
-rw-r--r--Source/SPCharsetCollationHelper.m15
3 files changed, 13 insertions, 10 deletions
diff --git a/Interfaces/English.lproj/MainMenu.xib b/Interfaces/English.lproj/MainMenu.xib
index 73c3505d..22664443 100644
--- a/Interfaces/English.lproj/MainMenu.xib
+++ b/Interfaces/English.lproj/MainMenu.xib
@@ -1412,7 +1412,7 @@
</object>
<object class="NSMenuItem" id="85590918">
<reference key="NSMenu" ref="315159986"/>
- <string key="NSTitle">UTF-8 Unicode (utf8)</string>
+ <string key="NSTitle">UTF-8 Unicode BMP (utf8)</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
@@ -1422,7 +1422,7 @@
</object>
<object class="NSMenuItem" id="383065474">
<reference key="NSMenu" ref="315159986"/>
- <string key="NSTitle">4-Byte UTF-8 Unicode (utf8mb4)</string>
+ <string key="NSTitle">UTF-8 Full Unicode (utf8mb4)</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
diff --git a/Interfaces/English.lproj/Preferences.xib b/Interfaces/English.lproj/Preferences.xib
index 590dde4e..4901f537 100644
--- a/Interfaces/English.lproj/Preferences.xib
+++ b/Interfaces/English.lproj/Preferences.xib
@@ -640,7 +640,7 @@
</object>
<object class="NSMenuItem" id="658105746">
<reference key="NSMenu" ref="1035849972"/>
- <string key="NSTitle">UTF-8 Unicode (utf8)</string>
+ <string key="NSTitle">UTF-8 Unicode BMP (utf8)</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
@@ -652,7 +652,7 @@
</object>
<object class="NSMenuItem" id="89605484">
<reference key="NSMenu" ref="1035849972"/>
- <string key="NSTitle">4-Byte UTF-8 Unicode (utf8mb4)</string>
+ <string key="NSTitle">UTF-8 Full Unicode (utf8mb4)</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
diff --git a/Source/SPCharsetCollationHelper.m b/Source/SPCharsetCollationHelper.m
index 14b0a987..378fb7cf 100644
--- a/Source/SPCharsetCollationHelper.m
+++ b/Source/SPCharsetCollationHelper.m
@@ -133,6 +133,8 @@
if (([encodings count] > 0) && [serverSupport supportsPost41CharacterSetHandling]) {
+ NSUInteger utf8encounters = 0;
+
for (NSDictionary *encoding in encodings)
{
NSString *charsetId = [encoding objectForKey:@"CHARACTER_SET_NAME"];
@@ -146,12 +148,9 @@
if(selectedCharset && [charsetId isEqualToString:selectedCharset])
selectedRef = menuItem;
- // If the UTF8 entry has been encountered, promote it to the top of the list
- if (promoteUTF8 && [charsetId isEqualToString:@"utf8"]) {
- [[charsetButton menu] insertItem:[menuItem autorelease] atIndex:0];
- //only add a separator if there actually are more items other than utf8 (might not be true for mysql forks)
- if([encodings count] > 1)
- [[charsetButton menu] insertItem:[NSMenuItem separatorItem] atIndex:1];
+ // If an UTF8 entry has been encountered, promote it to the top of the list
+ if (promoteUTF8 && [charsetId hasPrefix:@"utf8"]) {
+ [[charsetButton menu] insertItem:[menuItem autorelease] atIndex:(utf8encounters++)];
}
else {
[[charsetButton menu] addItem:[menuItem autorelease]];
@@ -159,6 +158,10 @@
}
+ //only add a separator if there actually are more items other than utf8 (might not be true for mysql forks)
+ if(utf8encounters && [encodings count] > utf8encounters)
+ [[charsetButton menu] insertItem:[NSMenuItem separatorItem] atIndex:utf8encounters];
+
[charsetButton setEnabled:YES];
}