Overview
Comment: | Add ISO-8859-3 |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
52e6e8aa8992652732f6719f504bc59b |
User & Date: | js on 2017-02-05 22:47:55 |
Other Links: | manifest | tags |
Context
2017-02-05
| ||
23:46 | Fix a typo check-in: 2213799d64 user: js tags: trunk | |
22:47 | Add ISO-8859-3 check-in: 52e6e8aa89 user: js tags: trunk | |
21:22 | Add KOI8-U encoding check-in: 2c489201b7 user: js tags: trunk | |
Changes
Modified configure.ac from [dd01c03aba] to [e97c0cc79e].
︙ | |||
609 610 611 612 613 614 615 616 617 618 619 620 621 622 | 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 | + | ENCODINGS_SRCS="$ENCODINGS_SRCS $2.m" ]) ]) ENCODING_FLAG(codepage-437, codepage_437, [Codepage 437], HAVE_CODEPAGE_437) ENCODING_FLAG(codepage-850, codepage_850, [Codepage 850], HAVE_CODEPAGE_850) ENCODING_FLAG(codepage-858, codepage_858, [Codepage 858], HAVE_CODEPAGE_858) ENCODING_FLAG(iso-8859-2, iso_8859_2, [ISO 8859-2], HAVE_ISO_8859_2) ENCODING_FLAG(iso-8859-3, iso_8859_3, [ISO 8859-3], HAVE_ISO_8859_3) ENCODING_FLAG(iso-8859-15, iso_8859_15, [ISO 8859-15], HAVE_ISO_8859_15) ENCODING_FLAG(koi8-r, koi8_r, [KOI8-R], HAVE_KOI8_R) ENCODING_FLAG(koi8-u, koi8_u, [KOI8-U], HAVE_KOI8_U) ENCODING_FLAG(mac-roman, mac_roman, [Mac Roman encoding], HAVE_MAC_ROMAN) ENCODING_FLAG(windows-1251, windows_1251, [Windows-1251], HAVE_WINDOWS_1251) ENCODING_FLAG(windows-1252, windows_1252, [Windows-1252], HAVE_WINDOWS_1252) |
︙ |
Modified src/OFString.h from [29d3db12c3] to [c2a7cfd375].
︙ | |||
56 57 58 59 60 61 62 63 64 65 66 67 68 69 | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | + + | 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-3 */ OF_STRING_ENCODING_ISO_8859_3, /*! 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 [318583ea01] to [d951599798].
︙ | |||
86 87 88 89 90 91 92 93 94 95 96 97 98 99 | 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | + + | - (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_3(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); |
︙ | |||
142 143 144 145 146 147 148 149 150 151 152 153 154 155 | 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | + + + | encoding = OF_STRING_ENCODING_ASCII; else if ([string isEqual: @"iso-8859-1"] || [string isEqual: @"iso_8859-1"]) encoding = OF_STRING_ENCODING_ISO_8859_1; else if ([string isEqual: @"iso-8859-2"] || [string isEqual: @"iso_8859-2"]) encoding = OF_STRING_ENCODING_ISO_8859_2; else if ([string isEqual: @"iso-8859-3"] || [string isEqual: @"iso_8859-3"]) encoding = OF_STRING_ENCODING_ISO_8859_3; else if ([string isEqual: @"iso-8859-15"] || [string isEqual: @"iso_8859-15"]) encoding = OF_STRING_ENCODING_ISO_8859_15; else if ([string isEqual: @"windows-1251"] || [string isEqual: @"cp1251"] || [string isEqual: @"cp-1251"] || [string isEqual: @"1251"]) encoding = OF_STRING_ENCODING_WINDOWS_1251; |
︙ | |||
1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 | 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 | + + + + + + + + + + + + + | if (!of_unicode_to_iso_8859_2(characters, (unsigned char*)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; #endif #ifdef HAVE_ISO_8859_3 case OF_STRING_ENCODING_ISO_8859_3: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; if (!of_unicode_to_iso_8859_3(characters, (unsigned char*)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; #endif #ifdef HAVE_ISO_8859_15 case OF_STRING_ENCODING_ISO_8859_15: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; |
︙ | |||
1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 | 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 | + | /* 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_3: 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: |
︙ | |||
1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 | 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 | + | 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_3: 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 [37fcb522a7] to [b5d78abf98].
︙ | |||
35 36 37 38 39 40 41 42 43 44 45 46 47 48 | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | + | #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_3[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]; |
︙ | |||
293 294 295 296 297 298 299 300 301 302 303 304 305 306 | 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 | + + + + + | } switch (encoding) { #ifdef HAVE_ISO_8859_2 case OF_STRING_ENCODING_ISO_8859_2: table = of_iso_8859_2; break; #endif #ifdef HAVE_ISO_8859_3 case OF_STRING_ENCODING_ISO_8859_3: table = of_iso_8859_3; break; #endif #ifdef HAVE_ISO_8859_15 case OF_STRING_ENCODING_ISO_8859_15: table = of_iso_8859_15; break; #endif #ifdef HAVE_WINDOWS_1251 |
︙ |
Added src/encodings/iso_8859_3.m version [34c3f86b95].