Overview
Comment: | Add support for Windows-1250 encoding |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
4d82cae50d9b56881e6f9ff3e9744a10 |
User & Date: | js on 2024-07-28 14:45:09 |
Other Links: | manifest | tags |
Context
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 | |
2024-07-27
| ||
23:48 | platform.h: Add SuperH check-in: 43af96a7c8 user: js tags: trunk | |
Changes
Modified configure.ac from [da5b98bd30] to [8ff1296bff].
︙ | |||
933 934 935 936 937 938 939 940 941 942 943 944 945 946 | 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 | + | 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-1250, windows_1250, [Windows-1250], HAVE_WINDOWS_1250) ENCODING_FLAG(windows-1251, windows_1251, [Windows-1251], HAVE_WINDOWS_1251) ENCODING_FLAG(windows-1252, windows_1252, [Windows-1252], HAVE_WINDOWS_1252) AS_IF([test x"$ENCODINGS_SRCS" = x""], [ ENCODINGS_SRCS="dummy.m" ]) AC_SUBST(ENCODINGS_SRCS) |
︙ |
Modified src/OFString.h from [35675702ad] to [8f85c16a4b].
︙ | |||
91 92 93 94 95 96 97 98 99 100 101 102 103 104 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | + + | OFStringEncodingCodepage858, /** Mac OS Roman */ OFStringEncodingMacRoman, /** KOI8-R */ OFStringEncodingKOI8R, /** KOI8-U */ OFStringEncodingKOI8U, /** Windows-1250 */ OFStringEncodingWindows1250, /** Try to automatically detect the encoding */ OFStringEncodingAutodetect = -1 } OFStringEncoding; /** * @brief Options for searching in strings. * |
︙ |
Modified src/OFString.m from [7205f31b8d] to [6384f6bbc6].
︙ | |||
106 107 108 109 110 111 112 113 114 115 116 117 118 119 | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | + + | extern bool _OFUnicodeToISO8859_2(const OFUnichar *, unsigned char *, size_t, bool); extern bool _OFUnicodeToISO8859_3(const OFUnichar *, unsigned char *, size_t, bool); extern bool _OFUnicodeToISO8859_15(const OFUnichar *, unsigned char *, size_t, bool); extern bool _OFUnicodeToWindows1250(const OFUnichar *, unsigned char *, size_t, bool); extern bool _OFUnicodeToWindows1251(const OFUnichar *, unsigned char *, 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 *, |
︙ | |||
168 169 170 171 172 173 174 175 176 177 178 179 180 181 | 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | + + + + | encoding = OFStringEncodingISO8859_2; else if ([string isEqual: @"iso-8859-3"] || [string isEqual: @"iso_8859-3"]) encoding = OFStringEncodingISO8859_3; else if ([string isEqual: @"iso-8859-15"] || [string isEqual: @"iso_8859-15"]) encoding = OFStringEncodingISO8859_15; else if ([string isEqual: @"windows-1250"] || [string isEqual: @"cp1250"] || [string isEqual: @"cp-1250"] || [string isEqual: @"1250"]) encoding = OFStringEncodingWindows1250; else if ([string isEqual: @"windows-1251"] || [string isEqual: @"cp1251"] || [string isEqual: @"cp-1251"] || [string isEqual: @"1251"]) encoding = OFStringEncodingWindows1251; else if ([string isEqual: @"windows-1252"] || [string isEqual: @"cp1252"] || [string isEqual: @"cp-1252"] || [string isEqual: @"1252"]) |
︙ | |||
215 216 217 218 219 220 221 222 223 224 225 226 227 228 | 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | + + | return @"ISO 8859-1"; case OFStringEncodingISO8859_2: return @"ISO 8859-2"; case OFStringEncodingISO8859_3: return @"ISO 8859-3"; case OFStringEncodingISO8859_15: return @"ISO 8859-15"; case OFStringEncodingWindows1250: return @"Windows-1250"; case OFStringEncodingWindows1251: return @"Windows-1251"; case OFStringEncodingWindows1252: return @"Windows-1252"; case OFStringEncodingCodepage437: return @"Codepage 437"; case OFStringEncodingCodepage850: |
︙ | |||
1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 | 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 | + + + + + + + + + + + + + | if (!_OFUnicodeToISO8859_15(characters, (unsigned char *)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; #endif #ifdef HAVE_WINDOWS_1250 case OFStringEncodingWindows1250: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; if (!_OFUnicodeToWindows1250(characters, (unsigned char *)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; #endif #ifdef HAVE_WINDOWS_1251 case OFStringEncodingWindows1251: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; |
︙ | |||
1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 | 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 | + | break; case OFStringEncodingASCII: case OFStringEncodingISO8859_1: case OFStringEncodingISO8859_2: case OFStringEncodingISO8859_3: case OFStringEncodingISO8859_15: case OFStringEncodingWindows1250: case OFStringEncodingWindows1251: case OFStringEncodingWindows1252: case OFStringEncodingCodepage437: case OFStringEncodingCodepage850: case OFStringEncodingCodepage858: case OFStringEncodingMacRoman: case OFStringEncodingKOI8R: |
︙ | |||
1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 | 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 | + | return UTF8StringLength; case OFStringEncodingASCII: case OFStringEncodingISO8859_1: case OFStringEncodingISO8859_2: case OFStringEncodingISO8859_3: case OFStringEncodingISO8859_15: case OFStringEncodingWindows1250: case OFStringEncodingWindows1251: case OFStringEncodingWindows1252: case OFStringEncodingCodepage437: case OFStringEncodingCodepage850: case OFStringEncodingCodepage858: case OFStringEncodingMacRoman: case OFStringEncodingKOI8R: |
︙ |
Modified src/OFUTF8String.m from [97ab3896de] to [c81adad54b].
︙ | |||
45 46 47 48 49 50 51 52 53 54 55 56 57 58 | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | + + | extern const OFChar16 _OFISO8859_2Table[]; extern const size_t _OFISO8859_2TableOffset; extern const OFChar16 _OFISO8859_3Table[]; extern const size_t _OFISO8859_3TableOffset; extern const OFChar16 _OFISO8859_15Table[]; extern const size_t _OFISO8859_15TableOffset; extern const OFChar16 _OFWindows1250Table[]; extern const size_t _OFWindows1250TableOffset; extern const OFChar16 _OFWindows1251Table[]; 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[]; |
︙ | |||
320 321 322 323 324 325 326 327 328 329 330 331 332 333 | 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 | + + + | #endif #ifdef HAVE_ISO_8859_3 CASE(OFStringEncodingISO8859_3, _OFISO8859_3Table) #endif #ifdef HAVE_ISO_8859_15 CASE(OFStringEncodingISO8859_15, _OFISO8859_15Table) #endif #ifdef HAVE_WINDOWS_1250 CASE(OFStringEncodingWindows1250, _OFWindows1250Table) #endif #ifdef HAVE_WINDOWS_1251 CASE(OFStringEncodingWindows1251, _OFWindows1251Table) #endif #ifdef HAVE_WINDOWS_1252 CASE(OFStringEncodingWindows1252, _OFWindows1252Table) #endif #ifdef HAVE_CODEPAGE_437 |
︙ |
Modified src/encodings/common.h from [2d2c203547] to [431a834c37].
︙ | |||
14 15 16 17 18 19 20 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | - + - + | * * You should have received a copy of the GNU Lesser General Public License * version 3.0 along with this program. If not, see * <https://www.gnu.org/licenses/>. */ #define CASE_MISSING_IS_KEEP(nr) \ |
︙ | |||
49 50 51 52 53 54 55 | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | - + | continue; \ } else \ return false; \ } \ \ idx = (c & 0xFF) - page##nr##Start; \ \ |
Added src/encodings/windows-1250.m version [66d83a46d2].