Overview
Comment: | Add ISO-8859-2 |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
7a27ce7b0b2994b2a207543a5bca250d |
User & Date: | js on 2017-01-17 03:23:54 |
Other Links: | manifest | tags |
Context
2017-01-18
| ||
03:45 | Move parsing of encoding names to a single place check-in: 4c8d02cc0d user: js tags: trunk | |
2017-01-17
| ||
03:23 | Add ISO-8859-2 check-in: 7a27ce7b0b user: js tags: trunk | |
01:20 | Allow iso_8859-* spellings for encoding check-in: 238d47a1d6 user: js tags: trunk | |
Changes
Modified ObjFW.xcodeproj/project.pbxproj from [740861cba4] to [69a26f2925].
︙ | |||
964 965 966 967 968 969 970 971 972 973 974 975 976 977 | 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 | + + | 4BF33B12133807A20059CEF7 /* TestsAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B6EF6811235358D0076B512 /* TestsAppDelegate.m */; }; 4BF33B4713380CE20059CEF7 /* testfile.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4BF33B4313380CD40059CEF7 /* testfile.txt */; }; 4BF33B4813380D2D0059CEF7 /* testfile.bin in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4BF33B4213380CD40059CEF7 /* testfile.bin */; }; 4BF3A2291E25EA48002EA46F /* windows_1251.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BF3A2281E25EA48002EA46F /* windows_1251.m */; }; 4BF3A22A1E25EA48002EA46F /* windows_1251.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BF3A2281E25EA48002EA46F /* windows_1251.m */; }; 4BF48CE118A95F83000E8D04 /* OFBigDataArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF48CDF18A95F83000E8D04 /* OFBigDataArray.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4BF48CE218A95F83000E8D04 /* OFBigDataArray.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BF48CE018A95F83000E8D04 /* OFBigDataArray.m */; }; 4BF5CB901E2DC1D800CF7584 /* iso_8859_2.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BF5CB8F1E2DC1D800CF7584 /* iso_8859_2.m */; }; 4BF5CB911E2DC1D800CF7584 /* iso_8859_2.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BF5CB8F1E2DC1D800CF7584 /* iso_8859_2.m */; }; 4BF69CE61BD44F8B00DFFC1B /* platform.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF69CE51BD44F8B00DFFC1B /* platform.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4BFF3714177E17C100192782 /* OFRemoveItemFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BFF3710177E17C100192782 /* OFRemoveItemFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4BFF3715177E17C100192782 /* OFRemoveItemFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BFF3711177E17C100192782 /* OFRemoveItemFailedException.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 4B23CA8E133811B20047A1D9 /* PBXContainerItemProxy */ = { |
︙ | |||
1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 | 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 | + | 4BF1BCCF11C9663F0025511F /* OFXMLAttribute.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFXMLAttribute.m; path = src/OFXMLAttribute.m; sourceTree = "<group>"; }; 4BF33AF0133807310059CEF7 /* Tests */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Tests; sourceTree = BUILT_PRODUCTS_DIR; }; 4BF33B4213380CD40059CEF7 /* testfile.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; name = testfile.bin; path = tests/testfile.bin; sourceTree = "<group>"; }; 4BF33B4313380CD40059CEF7 /* testfile.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = testfile.txt; path = tests/testfile.txt; sourceTree = "<group>"; }; 4BF3A2281E25EA48002EA46F /* windows_1251.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = windows_1251.m; path = src/windows_1251.m; sourceTree = "<group>"; }; 4BF48CDF18A95F83000E8D04 /* OFBigDataArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFBigDataArray.h; path = src/OFBigDataArray.h; sourceTree = "<group>"; }; 4BF48CE018A95F83000E8D04 /* OFBigDataArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFBigDataArray.m; path = src/OFBigDataArray.m; sourceTree = "<group>"; }; 4BF5CB8F1E2DC1D800CF7584 /* iso_8859_2.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = iso_8859_2.m; path = src/iso_8859_2.m; sourceTree = "<group>"; }; 4BF69CE51BD44F8B00DFFC1B /* platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = platform.h; path = src/platform.h; sourceTree = "<group>"; }; 4BFBDD1610A0724800051AFB /* unicode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = unicode.m; path = src/unicode.m; sourceTree = "<group>"; }; 4BFF3710177E17C100192782 /* OFRemoveItemFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFRemoveItemFailedException.h; path = src/exceptions/OFRemoveItemFailedException.h; sourceTree = "<group>"; }; 4BFF3711177E17C100192782 /* OFRemoveItemFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFRemoveItemFailedException.m; path = src/exceptions/OFRemoveItemFailedException.m; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ |
︙ | |||
2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 | 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 | + | 4BB52CC617B8EA7F00B7EBF5 /* codepage_437.m */, 4B5EBFB51E25A8CF004FE6A2 /* codepage_850.m */, 4B6736111E2B2F6F00681F2C /* codepage_858.m */, 4B881D391CCBFE0700E2F7D8 /* crc32.h */, 4B881D3A1CCBFE0700E2F7D8 /* crc32.m */, 4B837D7816829C5F007A3E83 /* instance.h */, 4B6AF96F10A8D40E0003FB0A /* iso_8859_15.m */, 4BF5CB8F1E2DC1D800CF7584 /* iso_8859_2.m */, 4BE17AD812FD744C002CEB0B /* foundation-compat.m */, 4BBA36C511406AB700CBA3AC /* macros.h */, 4B5EBFB81E25A937004FE6A2 /* mac_roman.m */, 4BF1BCBF11C9663F0025511F /* objfw-defs.h.in */, 4BB50DCF12F863C700C9393F /* of_asprintf.h */, 4BB50DD012F863C700C9393F /* of_asprintf.m */, 4BA355BC14879BF700442EF4 /* of_strptime.h */, |
︙ | |||
3194 3195 3196 3197 3198 3199 3200 3201 | 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 | + - + | 4B2C21871DA292BE00735907 /* OFZIPArchive.m in Sources */, 4B2C21881DA292BE00735907 /* OFZIPArchiveEntry.m in Sources */, 4B2C21891DA292BE00735907 /* base64.m in Sources */, 4B2C218A1DA292BE00735907 /* codepage_437.m in Sources */, 4B5EBFB71E25A8CF004FE6A2 /* codepage_850.m in Sources */, 4B6736131E2B2F6F00681F2C /* codepage_858.m in Sources */, 4B2C218B1DA292BE00735907 /* crc32.m in Sources */, 4B2C218D1DA292BE00735907 /* foundation-compat.m in Sources */, 4B2C218C1DA292BE00735907 /* iso_8859_15.m in Sources */, |
︙ | |||
3387 3388 3389 3390 3391 3392 3393 3394 | 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 | + - + | 4BE52D2217B990B4005958D1 /* OFZIPArchive.m in Sources */, 4B8B025A17BBA7C7009ED983 /* OFZIPArchiveEntry.m in Sources */, 4B3D23B31337FC0D00DD29B8 /* base64.m in Sources */, 4BB52CC717B8EA7F00B7EBF5 /* codepage_437.m in Sources */, 4B5EBFB61E25A8CF004FE6A2 /* codepage_850.m in Sources */, 4B6736121E2B2F6F00681F2C /* codepage_858.m in Sources */, 4B881D3D1CCBFE2A00E2F7D8 /* crc32.m in Sources */, 4B3D23B51337FC0D00DD29B8 /* foundation-compat.m in Sources */, 4B3D23B41337FC0D00DD29B8 /* iso_8859_15.m in Sources */, |
︙ |
Modified src/Makefile from [49d1e7099f] to [2a339f550a].
︙ | |||
155 156 157 158 159 160 161 162 163 164 165 166 167 168 | 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | + | ${AUTORELEASE_M} \ codepage_437.m \ codepage_850.m \ codepage_858.m \ ${FOUNDATION_COMPAT_M} \ ${INSTANCE_M} \ iso_8859_15.m \ iso_8859_2.m \ mac_roman.m \ ${UNICODE_M} \ windows_1251.m \ windows_1252.m SRCS_FILES += OFSettings_INIFile.m SRCS_SOCKETS += ${OFKERNELEVENTOBSERVER_EPOLL_M} \ ${OFKERNELEVENTOBSERVER_KQUEUE_M} \ |
︙ |
Modified src/OFHTTPResponse.m from [f8cf1ed9b2] to [f2cda29146].
︙ | |||
112 113 114 115 116 117 118 119 120 121 122 123 124 125 | 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | + + + | contentType = [contentType lowercaseString]; if ([contentType hasSuffix: @"charset=utf-8"]) encoding = OF_STRING_ENCODING_UTF_8; else if ([contentType hasSuffix: @"charset=iso-8859-1"] || [contentType hasSuffix: @"charset=iso_8859-1"]) encoding = OF_STRING_ENCODING_ISO_8859_1; else if ([contentType hasSuffix: @"charset=iso-8859-2"] || [contentType hasSuffix: @"charset=iso_8859-2"]) encoding = OF_STRING_ENCODING_ISO_8859_2; else if ([contentType hasSuffix: @"charset=iso-8859-15"] || [contentType hasSuffix: @"charset=iso_8859-15"]) encoding = OF_STRING_ENCODING_ISO_8859_15; else if ([contentType hasSuffix: @"charset=windows-1251"] || [contentType hasSuffix: @"charset=cp1251"] || [contentType hasSuffix: @"charset=cp-1251"]) encoding = OF_STRING_ENCODING_WINDOWS_1251; |
︙ |
Modified src/OFLocalization.m from [e47e440130] to [469e0664e7].
︙ | |||
102 103 104 105 106 107 108 109 110 111 112 113 114 115 | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | + + + + | else if (strcmp(tmp, "ascii") == 0 || strcmp(tmp, "us-ascii") == 0) _encoding = OF_STRING_ENCODING_ASCII; else if (strcmp(tmp, "iso8859-1") == 0 || strcmp(tmp, "iso-8859-1") == 0 || strcmp(tmp, "iso_8859-1") == 0) _encoding = OF_STRING_ENCODING_ISO_8859_1; else if (strcmp(tmp, "iso8859-2") == 0 || strcmp(tmp, "iso-8859-2") == 0 || strcmp(tmp, "iso_8859-2") == 0) _encoding = OF_STRING_ENCODING_ISO_8859_2; else if (strcmp(tmp, "iso8859-15") == 0 || strcmp(tmp, "iso-8859-15") == 0 || strcmp(tmp, "iso_8859-15") == 0) _encoding = OF_STRING_ENCODING_ISO_8859_15; /* Windows and DJGPP use a codepage */ else if (strcmp(tmp, "1251") == 0) _encoding = OF_STRING_ENCODING_WINDOWS_1251; |
︙ |
Modified src/OFString.h from [c6d4af2673] to [09f33d7338].
︙ | |||
54 55 56 57 58 59 60 61 62 63 64 65 66 67 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | + + | */ /*! UTF-8 */ OF_STRING_ENCODING_UTF_8, /*! ASCII */ OF_STRING_ENCODING_ASCII, /*! ISO 8859-1 */ OF_STRING_ENCODING_ISO_8859_1, /*! ISO 8859-2 */ OF_STRING_ENCODING_ISO_8859_2, /*! ISO 8859-15 */ OF_STRING_ENCODING_ISO_8859_15, /*! Windows-1251 */ OF_STRING_ENCODING_WINDOWS_1251, /*! Windows-1252 */ OF_STRING_ENCODING_WINDOWS_1252, /*! Codepage 437 */ |
︙ |
Modified src/OFString.m from [3404c5b7b6] to [0c0cd023b8].
︙ | |||
85 86 87 88 89 90 91 92 93 94 95 96 97 98 | 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | + + | lossy: (bool)lossy; - (const char*)OF_cStringWithEncoding: (of_string_encoding_t)encoding lossy: (bool)lossy; - (OFString*)OF_JSONRepresentationWithOptions: (int)options depth: (size_t)depth; @end extern bool of_unicode_to_iso_8859_2(const of_unichar_t*, unsigned char*, size_t, bool); extern bool of_unicode_to_iso_8859_15(const of_unichar_t*, unsigned char*, size_t, bool); extern bool of_unicode_to_windows_1251(const of_unichar_t*, unsigned char*, size_t, bool); extern bool of_unicode_to_windows_1252(const of_unichar_t*, unsigned char*, size_t, bool); extern bool of_unicode_to_codepage_437(const of_unichar_t*, unsigned char*, |
︙ | |||
1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 | 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 | + + + + + + + + + + + | exception]; } else cString[i] = (unsigned char)characters[i]; } cString[i] = '\0'; return length; case OF_STRING_ENCODING_ISO_8859_2: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; if (!of_unicode_to_iso_8859_2(characters, (unsigned char*)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; case OF_STRING_ENCODING_ISO_8859_15: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; if (!of_unicode_to_iso_8859_15(characters, (unsigned char*)cString, length, lossy)) |
︙ | |||
1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 | 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 | + | } @catch (OFOutOfMemoryException *e) { /* We don't care, as we only tried to make it smaller */ } break; case OF_STRING_ENCODING_ASCII: case OF_STRING_ENCODING_ISO_8859_1: case OF_STRING_ENCODING_ISO_8859_2: case OF_STRING_ENCODING_ISO_8859_15: case OF_STRING_ENCODING_WINDOWS_1251: case OF_STRING_ENCODING_WINDOWS_1252: case OF_STRING_ENCODING_CODEPAGE_437: case OF_STRING_ENCODING_CODEPAGE_850: case OF_STRING_ENCODING_CODEPAGE_858: case OF_STRING_ENCODING_MAC_ROMAN: |
︙ | |||
1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 | 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 | + | UTF8StringLength += len; } return UTF8StringLength; case OF_STRING_ENCODING_ASCII: case OF_STRING_ENCODING_ISO_8859_1: case OF_STRING_ENCODING_ISO_8859_2: case OF_STRING_ENCODING_ISO_8859_15: case OF_STRING_ENCODING_WINDOWS_1251: case OF_STRING_ENCODING_WINDOWS_1252: case OF_STRING_ENCODING_CODEPAGE_437: case OF_STRING_ENCODING_CODEPAGE_850: case OF_STRING_ENCODING_CODEPAGE_858: case OF_STRING_ENCODING_MAC_ROMAN: |
︙ |
Modified src/OFString_UTF8.m from [f5ba43aeaa] to [4623150629].
︙ | |||
34 35 36 37 38 39 40 41 42 43 44 45 46 47 | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | + | #import "OFInvalidFormatException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "of_asprintf.h" #import "unicode.h" extern const of_char16_t of_iso_8859_2[128]; extern const of_char16_t of_iso_8859_15[128]; extern const of_char16_t of_windows_1251[128]; extern const of_char16_t of_windows_1252[128]; extern const of_char16_t of_codepage_437[128]; extern const of_char16_t of_codepage_850[128]; extern const of_char16_t of_codepage_858[128]; extern const of_char16_t of_mac_roman[128]; |
︙ | |||
286 287 288 289 290 291 292 293 294 295 296 297 298 299 | 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | + + + | _s->cString[_s->cStringLength] = 0; return self; } switch (encoding) { case OF_STRING_ENCODING_ISO_8859_2: table = of_iso_8859_2; break; case OF_STRING_ENCODING_ISO_8859_15: table = of_iso_8859_15; break; case OF_STRING_ENCODING_WINDOWS_1251: table = of_windows_1251; break; case OF_STRING_ENCODING_WINDOWS_1252: |
︙ |
Modified src/OFXMLParser.m from [a54e16b4ae] to [72d9697aa5].
︙ | |||
466 467 468 469 470 471 472 473 474 475 476 477 478 479 | 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 | + + + + | if ([value isEqual: @"utf-8"]) _encoding = OF_STRING_ENCODING_UTF_8; else if ([value isEqual: @"iso-8859-1"] || [value isEqual: @"iso_8859-1"]) _encoding = OF_STRING_ENCODING_ISO_8859_1; else if ([value isEqual: @"iso-8859-2"] || [value isEqual: @"iso_8859-2"]) _encoding = OF_STRING_ENCODING_ISO_8859_2; else if ([value isEqual: @"iso-8859-15"] || [value isEqual: @"iso_8859-15"]) _encoding = OF_STRING_ENCODING_ISO_8859_15; else if ([value isEqual: @"windows-1251"] || [value isEqual: @"cp1251"] || [value isEqual: @"cp-1251"]) |
︙ |
Added src/iso_8859_2.m version [2027f831bd].