aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2014-12-19 17:05:15 +0100
committerMax <post@wickenrode.com>2014-12-19 17:05:15 +0100
commitf90b5d98b485aac53c793a6c2d4df5418d6cb14d (patch)
tree95d7d143e593f8ea1451e924cd923d9c2a411503
parentca6b8681a49d51b5dfafbb2647119ada070df8da (diff)
downloadsequelpro-f90b5d98b485aac53c793a6c2d4df5418d6cb14d.tar.gz
sequelpro-f90b5d98b485aac53c793a6c2d4df5418d6cb14d.tar.bz2
sequelpro-f90b5d98b485aac53c793a6c2d4df5418d6cb14d.zip
Add code for utf8mb4 encoding
-rw-r--r--Source/SPConstants.h3
-rw-r--r--Source/SPDatabaseDocument.m38
2 files changed, 22 insertions, 19 deletions
diff --git a/Source/SPConstants.h b/Source/SPConstants.h
index f630dd49..60787559 100644
--- a/Source/SPConstants.h
+++ b/Source/SPConstants.h
@@ -177,7 +177,8 @@ typedef enum
SPEncodingBig5Chinese = 150,
SPEncodingShiftJISJapanese = 160,
SPEncodingEUCJPJapanese = 170,
- SPEncodingEUCKRKorean = 180
+ SPEncodingEUCKRKorean = 180,
+ SPEncodingUTF8MB4 = 190
} SPEncodingTypes;
// Table index type menu tags
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index c62b42e4..9f5ce128 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -1649,7 +1649,8 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase";
@"big5" : @(SPEncodingBig5Chinese),
@"sjis" : @(SPEncodingShiftJISJapanese),
@"ujis" : @(SPEncodingEUCJPJapanese),
- @"euckr" : @(SPEncodingEUCKRKorean)
+ @"euckr" : @(SPEncodingEUCKRKorean),
+ @"utf8mb4" : @(SPEncodingUTF8MB4)
};
NSNumber *encodingTag = [translationMap valueForKey:mysqlEncoding];
@@ -1665,24 +1666,25 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase";
- (NSString *)mysqlEncodingFromEncodingTag:(NSNumber *)encodingTag
{
NSDictionary *translationMap = [NSDictionary dictionaryWithObjectsAndKeys:
- @"ucs2", [NSString stringWithFormat:@"%i", SPEncodingUCS2],
- @"utf8", [NSString stringWithFormat:@"%i", SPEncodingUTF8],
- @"utf8-", [NSString stringWithFormat:@"%i", SPEncodingUTF8viaLatin1],
- @"ascii", [NSString stringWithFormat:@"%i", SPEncodingASCII],
- @"latin1", [NSString stringWithFormat:@"%i", SPEncodingLatin1],
+ @"ucs2", [NSString stringWithFormat:@"%i", SPEncodingUCS2],
+ @"utf8", [NSString stringWithFormat:@"%i", SPEncodingUTF8],
+ @"utf8-", [NSString stringWithFormat:@"%i", SPEncodingUTF8viaLatin1],
+ @"ascii", [NSString stringWithFormat:@"%i", SPEncodingASCII],
+ @"latin1", [NSString stringWithFormat:@"%i", SPEncodingLatin1],
@"macroman", [NSString stringWithFormat:@"%i", SPEncodingMacRoman],
- @"cp1250", [NSString stringWithFormat:@"%i", SPEncodingCP1250Latin2],
- @"latin2", [NSString stringWithFormat:@"%i", SPEncodingISOLatin2],
- @"cp1256", [NSString stringWithFormat:@"%i", SPEncodingCP1256Arabic],
- @"greek", [NSString stringWithFormat:@"%i", SPEncodingGreek],
- @"hebrew", [NSString stringWithFormat:@"%i", SPEncodingHebrew],
- @"latin5", [NSString stringWithFormat:@"%i", SPEncodingLatin5Turkish],
- @"cp1257", [NSString stringWithFormat:@"%i", SPEncodingCP1257WinBaltic],
- @"cp1251", [NSString stringWithFormat:@"%i", SPEncodingCP1251WinCyrillic],
- @"big5", [NSString stringWithFormat:@"%i", SPEncodingBig5Chinese],
- @"sjis", [NSString stringWithFormat:@"%i", SPEncodingShiftJISJapanese],
- @"ujis", [NSString stringWithFormat:@"%i", SPEncodingEUCJPJapanese],
- @"euckr", [NSString stringWithFormat:@"%i", SPEncodingEUCKRKorean],
+ @"cp1250", [NSString stringWithFormat:@"%i", SPEncodingCP1250Latin2],
+ @"latin2", [NSString stringWithFormat:@"%i", SPEncodingISOLatin2],
+ @"cp1256", [NSString stringWithFormat:@"%i", SPEncodingCP1256Arabic],
+ @"greek", [NSString stringWithFormat:@"%i", SPEncodingGreek],
+ @"hebrew", [NSString stringWithFormat:@"%i", SPEncodingHebrew],
+ @"latin5", [NSString stringWithFormat:@"%i", SPEncodingLatin5Turkish],
+ @"cp1257", [NSString stringWithFormat:@"%i", SPEncodingCP1257WinBaltic],
+ @"cp1251", [NSString stringWithFormat:@"%i", SPEncodingCP1251WinCyrillic],
+ @"big5", [NSString stringWithFormat:@"%i", SPEncodingBig5Chinese],
+ @"sjis", [NSString stringWithFormat:@"%i", SPEncodingShiftJISJapanese],
+ @"ujis", [NSString stringWithFormat:@"%i", SPEncodingEUCJPJapanese],
+ @"euckr", [NSString stringWithFormat:@"%i", SPEncodingEUCKRKorean],
+ @"utf8mb4", [NSString stringWithFormat:@"%i", SPEncodingUTF8MB4],
nil];
NSString *mysqlEncoding = [translationMap valueForKey:[NSString stringWithFormat:@"%i", [encodingTag intValue]]];