Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch bug-bd1a60eb9c Excluding Merge-Ins
This is equivalent to a diff from 26aadbbd1f to c58db5881e
|
2023-02-14
| ||
| 21:42 | Fix for [bd1a60eb9c]: convertfrom utf-8 strict mode allows surrogates in input sequence check-in: 84f30c5d4e user: jan.nijtmans tags: core-8-branch | |
| 20:50 | Complete fix for [bd1a60eb9c]. Also fix a bug in the tableencoding. With testcases. Closed-Leaf check-in: c58db5881e user: jan.nijtmans tags: bug-bd1a60eb9c | |
| 10:43 | Fix for [b8f575aa2398b0e4] and [154ed7ce564a7b4c], double-[read]/[gets] problem. Partial-read functi... Closed-Leaf check-in: ecd7aaec80 user: pooryorick tags: py-b8f575aa23-nopartial | |
| 07:29 | Make a start fixing [bd1a60eb9c]. WIP check-in: 15fba8ddec user: jan.nijtmans tags: bug-bd1a60eb9c | |
|
2023-02-13
| ||
| 14:06 | merge 8.7 check-in: 49849c85bb user: dgp tags: core-8-7-b1-rc | |
| 10:12 | Merge 8.7. Mark (new) testcase encoding-16.15 as "knownBug": still needs a fix. check-in: a155df4adc user: jan.nijtmans tags: trunk, main | |
| 08:39 | Fix for [10c2c17c32]: UTF-LE32 encoder mapping of surrogates. With testcases (both for utf-32 and ut... check-in: 26aadbbd1f user: jan.nijtmans tags: core-8-branch | |
|
2023-02-12
| ||
| 00:49 | Proposed fix (and testcases) for [4a7397e0b3]: Tcl 9: fcopy with -strictencoding 1 UTF-8 channels check-in: 8b772479c3 user: jan.nijtmans tags: core-8-branch | |
|
2023-02-09
| ||
| 19:52 | Add 4 more testcases, showing that the same bug is present in utf-16 as well. Also fix the bug (real... Closed-Leaf check-in: 0ecd1a4f6d user: jan.nijtmans tags: bug-10c2c17c32 | |
Changes to generic/tclEncoding.c.
| ︙ | |||
515 516 517 518 519 520 521 | 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 | - + + | * *--------------------------------------------------------------------------- */ /* Since TCL_ENCODING_MODIFIED is only used for utf-8/cesu-8 and * TCL_ENCODING_LE is only used for utf-16/utf-32/ucs-2. re-use the same value */ #define TCL_ENCODING_LE TCL_ENCODING_MODIFIED /* Little-endian encoding */ |
| ︙ | |||
557 558 559 560 561 562 563 | 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 | - + |
tclIdentityEncoding = Tcl_CreateEncoding(&type);
type.encodingName = "utf-8";
type.toUtfProc = UtfToUtfProc;
type.fromUtfProc = UtfToUtfProc;
type.freeProc = NULL;
type.nullSize = 1;
|
| ︙ | |||
1234 1235 1236 1237 1238 1239 1240 | 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 | - + |
srcLen = 0;
} else if (srcLen < 0) {
srcLen = encodingPtr->lengthProc(src);
}
flags |= TCL_ENCODING_START | TCL_ENCODING_END;
if (encodingPtr->toUtfProc == UtfToUtfProc) {
|
| ︙ | |||
1351 1352 1353 1354 1355 1356 1357 | 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 | - + |
* the actual \0 at the end of the destination buffer, we need to
* append it manually. First make room for it...
*/
dstLen--;
}
if (encodingPtr->toUtfProc == UtfToUtfProc) {
|
| ︙ | |||
1446 1447 1448 1449 1450 1451 1452 | 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 | - + |
int
Tcl_UtfToExternalDStringEx(
Tcl_Encoding encoding, /* The encoding for the converted string, or
* NULL for the default system encoding. */
const char *src, /* Source string in UTF-8. */
int srcLen, /* Source string length in bytes, or < 0 for
* strlen(). */
|
| ︙ | |||
2359 2360 2361 2362 2363 2364 2365 | 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 | - + - + + - + + - + - + - + - + + + + + + - + - + |
}
if (flags & TCL_ENCODING_CHAR_LIMIT) {
charLimit = *dstCharsPtr;
}
dstStart = dst;
flags |= PTR2INT(clientData);
|
| ︙ | |||
3112 3113 3114 3115 3116 3117 3118 | 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 | - + + |
break;
}
ch = toUnicode[byte][*((unsigned char *) src)];
} else {
ch = pageZero[byte];
}
if ((ch == 0) && (byte != 0)) {
|
| ︙ |
Changes to tests/encoding.test.
| ︙ | |||
448 449 450 451 452 453 454 455 456 457 458 459 460 461 | 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 | + + + + + + + + + + + + + + + + + + |
list [string length $y] $z
} {2 c480}
test encoding-15.24 {UtfToUtfProc CESU-8 bug [048dd20b4171c8da]} {
set y [encoding convertto cesu-8 \u3FF]
binary scan $y H* z
list [string length $y] $z
} {2 cfbf}
test encoding-15.25 {UtfToUtfProc CESU-8} {
encoding convertfrom cesu-8 \x00
} \x00
test encoding-15.26 {UtfToUtfProc CESU-8} {
encoding convertfrom cesu-8 \xC0\x80
} \x00
test encoding-15.27 {UtfToUtfProc -strict CESU-8} {
encoding convertfrom -strict cesu-8 \xC0\x80
} \x00
test encoding-15.28 {UtfToUtfProc -strict CESU-8} {
encoding convertfrom -strict cesu-8 \xC0\x80
} \x00
test encoding-15.29 {UtfToUtfProc CESU-8} {
encoding convertto cesu-8 \x00
} \xC0\x80
test encoding-15.30 {UtfToUtfProc -strict CESU-8} {
encoding convertto -strict cesu-8 \x00
} \xC0\x80
test encoding-16.1 {Utf16ToUtfProc} -body {
set val [encoding convertfrom utf-16 NN]
list $val [format %x [scan $val %c]]
} -result "乎 4e4e"
test encoding-16.2 {Utf16ToUtfProc} -body {
set val [encoding convertfrom utf-16 "\xD8\xD8\xDC\xDC"]
|
| ︙ | |||
580 581 582 583 584 585 586 | 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 | - - + + + + + + + + + + + + + + + |
test encoding-18.5 {TableToUtfProc on invalid input with -failindex} -body {
list [catch {encoding convertto -failindex pos jis0208 \\} res] $res $pos
} -result {0 {} 0}
test encoding-18.6 {TableToUtfProc on invalid input with -nocomplain} -body {
list [catch {encoding convertto -nocomplain jis0208 \\} res] $res
} -result {0 !)}
|
| ︙ | |||
800 801 802 803 804 805 806 807 808 809 810 811 812 813 | 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 | + + + |
} -result \xED\xA0\x80
test encoding-24.39 {Try to generate invalid utf-8 with -strict} -body {
encoding convertto -strict utf-8 \uD800
} -returnCodes 1 -result {unexpected character at index 0: 'U+00D800'}
test encoding-24.40 {Try to generate invalid utf-8 with -nocomplain} -body {
encoding convertto -nocomplain utf-8 \uD800
} -result \xED\xA0\x80
test encoding-24.41 {Parse invalid utf-8 with -strict} -body {
encoding convertfrom -strict utf-8 \xED\xA0\x80\xED\xB0\x80
} -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\xED'}
file delete [file join [temporaryDirectory] iso2022.txt]
#
# Begin jajp encoding round-trip conformity tests
#
proc foreach-jisx0208 {varName command} {
|
| ︙ |