diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPConstants.h | 3 | ||||
-rw-r--r-- | Source/SPDatabaseDocument.m | 38 |
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]]]; |