Overview
Comment: | Add KOI8-U encoding |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
2c489201b7f3162784fe26de3e8950f3 |
User & Date: | js on 2017-02-05 21:22:55 |
Other Links: | manifest | tags |
Context
2017-02-05
| ||
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 | |
01:31 | Add KOI8-R encoding check-in: 59348cd51d user: js tags: trunk | |
Changes
Modified configure.ac from [8493d1aa1e] to [dd01c03aba].
︙ | |||
611 612 613 614 615 616 617 618 619 620 621 622 623 624 | 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 | + | ]) 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-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) AC_SUBST(ENCODINGS_SRCS) AS_IF([test x"$ENCODINGS_SRCS" != x""], [ AC_SUBST(ENCODINGS, "encodings") |
︙ |
Modified src/OFString.h from [7404ad4f5f] to [29d3db12c3].
︙ | |||
72 73 74 75 76 77 78 79 80 81 82 83 84 85 | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | + + | OF_STRING_ENCODING_CODEPAGE_850, /*! Codepage 858 */ OF_STRING_ENCODING_CODEPAGE_858, /*! Mac OS Roman */ OF_STRING_ENCODING_MAC_ROMAN, /*! KOI8-R */ OF_STRING_ENCODING_KOI8_R, /*! KOI8-U */ OF_STRING_ENCODING_KOI8_U, /*! Try to automatically detect the encoding */ OF_STRING_ENCODING_AUTODETECT = 0xFF } of_string_encoding_t; enum { OF_STRING_SEARCH_BACKWARDS = 1, OF_STRING_SKIP_EMPTY = 2 |
︙ |
Modified src/OFString.m from [5396444804] to [318583ea01].
︙ | |||
103 104 105 106 107 108 109 110 111 112 113 114 115 116 | 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | + + | size_t, bool); extern bool of_unicode_to_codepage_858(const of_unichar_t*, unsigned char*, size_t, bool); extern bool of_unicode_to_mac_roman(const of_unichar_t*, unsigned char*, size_t, bool); extern bool of_unicode_to_koi8_r(const of_unichar_t*, unsigned char*, size_t, bool); extern bool of_unicode_to_koi8_u(const of_unichar_t*, unsigned char*, size_t, bool); /* References for static linking */ void _references_to_categories_of_OFString(void) { _OFString_CryptoHashing_reference = 1; _OFString_JSONValue_reference = 1; |
︙ | |||
164 165 166 167 168 169 170 171 172 173 174 175 176 177 | 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | + + | else if ([string isEqual: @"cp858"] || [string isEqual: @"cp-858"] || [string isEqual: @"ibm858"] || [string isEqual: @"858"]) encoding = OF_STRING_ENCODING_CODEPAGE_858; else if ([string isEqual: @"macintosh"] || [string isEqual: @"mac"]) encoding = OF_STRING_ENCODING_MAC_ROMAN; else if ([string isEqual: @"koi8-r"]) encoding = OF_STRING_ENCODING_KOI8_R; else if ([string isEqual: @"koi8-u"]) encoding = OF_STRING_ENCODING_KOI8_U; else @throw [OFInvalidEncodingException exception]; objc_autoreleasePoolPop(pool); return encoding; } |
︙ | |||
1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 | 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 | + + + + + + + + + + + + + | (unsigned char*)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; #endif #ifdef HAVE_KOI8_U case OF_STRING_ENCODING_KOI8_U: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; if (!of_unicode_to_koi8_u(characters, (unsigned char*)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; #endif default: @throw [OFNotImplementedException exceptionWithSelector: _cmd object: self]; } } - (size_t)getCString: (char*)cString |
︙ | |||
1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 | 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 | + | 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: case OF_STRING_ENCODING_KOI8_R: case OF_STRING_ENCODING_KOI8_U: cString = [object allocMemoryWithSize: length + 1]; [self OF_getCString: cString maxLength: length + 1 encoding: encoding lossy: lossy]; |
︙ | |||
1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 | 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 | + | 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: case OF_STRING_ENCODING_KOI8_R: case OF_STRING_ENCODING_KOI8_U: return [self length]; default: @throw [OFInvalidEncodingException exception]; } } - (size_t)UTF8StringLength |
︙ |
Modified src/OFString_UTF8.m from [7036f0659c] to [37fcb522a7].
︙ | |||
43 44 45 46 47 48 49 50 51 52 53 54 55 56 | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | + | 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]; extern const of_char16_t of_koi8_r[128]; extern const of_char16_t of_koi8_u[128]; static inline int memcasecmp(const char *first, const char *second, size_t length) { for (size_t i = 0; i < length; i++) { unsigned char f = first[i]; unsigned char s = second[i]; |
︙ | |||
332 333 334 335 336 337 338 339 340 341 342 343 344 345 | 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | + + + + + | table = of_mac_roman; break; #endif #ifdef HAVE_KOI8_R case OF_STRING_ENCODING_KOI8_R: table = of_koi8_r; break; #endif #ifdef HAVE_KOI8_U case OF_STRING_ENCODING_KOI8_U: table = of_koi8_u; break; #endif default: @throw [OFInvalidEncodingException exception]; } j = 0; for (size_t i = 0; i < cStringLength; i++) { |
︙ |
Added src/encodings/koi8_u.m version [2867893b70].