Overview
Comment: | Add support for Codepage 852 |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
0c7de8be1dde4b14dc44266b1f162594 |
User & Date: | js on 2024-07-28 19:56:12 |
Other Links: | manifest | tags |
Context
2024-07-29
| ||
19:41 | -[OFKernelEventObserver cancel]: Handle EINTR check-in: ed598fd848 user: js tags: trunk | |
2024-07-28
| ||
19:56 | Add support for Codepage 852 check-in: 0c7de8be1d user: js tags: trunk | |
14:45 | Add support for Windows-1250 encoding check-in: 4d82cae50d user: js tags: trunk | |
Changes
Modified configure.ac from [8ff1296bff] to [749c4ad2d7].
︙ | |||
926 927 928 929 930 931 932 933 934 935 936 937 938 939 | 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 | + | AS_IF([test x"$enable_$2" != x"no"], [ AC_DEFINE($4, 1, [Whether we have support for $3]) ENCODINGS_SRCS="$ENCODINGS_SRCS $1.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-852, codepage_852, [Codepage 852], HAVE_CODEPAGE_852) 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) |
︙ |
Modified src/OFString.h from [8f85c16a4b] to [e2ec4dcbc3].
︙ | |||
93 94 95 96 97 98 99 100 101 102 103 104 105 106 | 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | + + | OFStringEncodingMacRoman, /** KOI8-R */ OFStringEncodingKOI8R, /** KOI8-U */ OFStringEncodingKOI8U, /** Windows-1250 */ OFStringEncodingWindows1250, /** Code page 852 */ OFStringEncodingCodepage852, /** Try to automatically detect the encoding */ OFStringEncodingAutodetect = -1 } OFStringEncoding; /** * @brief Options for searching in strings. * |
︙ |
Modified src/OFString.m from [6384f6bbc6] to [a4ffa9a80e].
︙ | |||
116 117 118 119 120 121 122 123 124 125 126 127 128 129 | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | + + | size_t, bool); extern bool _OFUnicodeToWindows1252(const OFUnichar *, unsigned char *, size_t, bool); extern bool _OFUnicodeToCodepage437(const OFUnichar *, unsigned char *, size_t, bool); extern bool _OFUnicodeToCodepage850(const OFUnichar *, unsigned char *, size_t, bool); extern bool _OFUnicodeToCodepage852(const OFUnichar *, unsigned char *, size_t, bool); extern bool _OFUnicodeToCodepage858(const OFUnichar *, unsigned char *, size_t, bool); extern bool _OFUnicodeToMacRoman(const OFUnichar *, unsigned char *, size_t, bool); extern bool _OFUnicodeToKOI8R(const OFUnichar *, unsigned char *, size_t, bool); extern bool _OFUnicodeToKOI8U(const OFUnichar *, unsigned char *, |
︙ | |||
188 189 190 191 192 193 194 195 196 197 198 199 200 201 | 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | + + + | encoding = OFStringEncodingWindows1252; else if ([string isEqual: @"cp437"] || [string isEqual: @"cp-437"] || [string isEqual: @"ibm437"] || [string isEqual: @"437"]) encoding = OFStringEncodingCodepage437; else if ([string isEqual: @"cp850"] || [string isEqual: @"cp-850"] || [string isEqual: @"ibm850"] || [string isEqual: @"850"]) encoding = OFStringEncodingCodepage850; else if ([string isEqual: @"cp852"] || [string isEqual: @"cp-852"] || [string isEqual: @"ibm852"] || [string isEqual: @"852"]) encoding = OFStringEncodingCodepage852; else if ([string isEqual: @"cp858"] || [string isEqual: @"cp-858"] || [string isEqual: @"ibm858"] || [string isEqual: @"858"]) encoding = OFStringEncodingCodepage858; else if ([string isEqual: @"macintosh"] || [string isEqual: @"mac"]) encoding = OFStringEncodingMacRoman; else if ([string isEqual: @"koi8-r"]) encoding = OFStringEncodingKOI8R; |
︙ | |||
231 232 233 234 235 236 237 238 239 240 241 242 243 244 | 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | + + | return @"Windows-1251"; case OFStringEncodingWindows1252: return @"Windows-1252"; case OFStringEncodingCodepage437: return @"Codepage 437"; case OFStringEncodingCodepage850: return @"Codepage 850"; case OFStringEncodingCodepage852: return @"Codepage 852"; case OFStringEncodingCodepage858: return @"Codepage 858"; case OFStringEncodingMacRoman: return @"Mac Roman"; case OFStringEncodingKOI8R: return @"KOI8-R"; case OFStringEncodingKOI8U: |
︙ | |||
1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 | 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 | + + + + + + + + + + + + + | if (!_OFUnicodeToCodepage850(characters, (unsigned char *)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; #endif #ifdef HAVE_CODEPAGE_852 case OFStringEncodingCodepage852: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; if (!_OFUnicodeToCodepage852(characters, (unsigned char *)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; #endif #ifdef HAVE_CODEPAGE_858 case OFStringEncodingCodepage858: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; |
︙ | |||
1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 | 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 | + | case OFStringEncodingISO8859_3: case OFStringEncodingISO8859_15: case OFStringEncodingWindows1250: case OFStringEncodingWindows1251: case OFStringEncodingWindows1252: case OFStringEncodingCodepage437: case OFStringEncodingCodepage850: case OFStringEncodingCodepage852: case OFStringEncodingCodepage858: case OFStringEncodingMacRoman: case OFStringEncodingKOI8R: case OFStringEncodingKOI8U: cString = OFAllocMemory(length + 1, 1); @try { |
︙ | |||
1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 | 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 | + | case OFStringEncodingISO8859_3: case OFStringEncodingISO8859_15: case OFStringEncodingWindows1250: case OFStringEncodingWindows1251: case OFStringEncodingWindows1252: case OFStringEncodingCodepage437: case OFStringEncodingCodepage850: case OFStringEncodingCodepage852: case OFStringEncodingCodepage858: case OFStringEncodingMacRoman: case OFStringEncodingKOI8R: case OFStringEncodingKOI8U: return self.length; default: @throw [OFInvalidArgumentException exception]; |
︙ |
Modified src/OFUTF8String.m from [c81adad54b] to [56475f9dfd].
︙ | |||
55 56 57 58 59 60 61 62 63 64 65 66 67 68 | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | + + | extern const size_t _OFWindows1251TableOffset; extern const OFChar16 _OFWindows1252Table[]; extern const size_t _OFWindows1252TableOffset; extern const OFChar16 _OFCodepage437Table[]; extern const size_t _OFCodepage437TableOffset; extern const OFChar16 _OFCodepage850Table[]; extern const size_t _OFCodepage850TableOffset; extern const OFChar16 _OFCodepage852Table[]; extern const size_t _OFCodepage852TableOffset; extern const OFChar16 _OFCodepage858Table[]; extern const size_t _OFCodepage858TableOffset; extern const OFChar16 _OFMacRomanTable[]; extern const size_t _OFMacRomanTableOffset; extern const OFChar16 _OFKOI8RTable[]; extern const size_t _OFKOI8RTableOffset; extern const OFChar16 _OFKOI8UTable[]; |
︙ | |||
337 338 339 340 341 342 343 344 345 346 347 348 349 350 | 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 | + + + | #endif #ifdef HAVE_CODEPAGE_437 CASE(OFStringEncodingCodepage437, _OFCodepage437Table) #endif #ifdef HAVE_CODEPAGE_850 CASE(OFStringEncodingCodepage850, _OFCodepage850Table) #endif #ifdef HAVE_CODEPAGE_852 CASE(OFStringEncodingCodepage852, _OFCodepage852Table) #endif #ifdef HAVE_CODEPAGE_858 CASE(OFStringEncodingCodepage858, _OFCodepage858Table) #endif #ifdef HAVE_MAC_ROMAN CASE(OFStringEncodingMacRoman, _OFMacRomanTable) #endif #ifdef HAVE_KOI8_R |
︙ |
Added src/encodings/codepage-852.m version [2e105e7181].