Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch tip-573 Excluding Merge-Ins
This is equivalent to a diff from 10e951f190 to c933eb1f2d
2020-05-18
| ||
12:47 | If Tcl is built with external libtommath (TCL_WITH_EXTERNAL_TOMMATH is defined), do the tests with t... check-in: 19a0e26fa4 user: jan.nijtmans tags: core-8-branch | |
11:51 | Merge 8.7 Closed-Leaf check-in: c933eb1f2d user: jan.nijtmans tags: tip-573 | |
10:51 | Merge 8.7. Update documentation check-in: 566357910d user: jan.nijtmans tags: tip-575 | |
10:10 | Adapt Tcl_UtfPrev()/Tcl_UtfNext() to be consistant with Tcl_UtfToUniChar() check-in: 6aa676e6bc user: jan.nijtmans tags: tip-573 | |
2020-05-14
| ||
10:27 | Merge 8.7 check-in: 4654931a26 user: jan.nijtmans tags: trunk | |
10:16 | Merge 8.6 check-in: 10e951f190 user: jan.nijtmans tags: core-8-branch | |
09:46 | In some places, Tcl_UtfPrev()/Tcl_UtfNext() is used traversing the individual bytes of a string sear... check-in: aa6cbf0a7f user: jan.nijtmans tags: core-8-6-branch | |
2020-05-13
| ||
19:57 | Sync testcases with 8.6 check-in: 7bddc02e53 user: jan.nijtmans tags: core-8-branch | |
Changes to generic/tclParse.c.
︙ | |||
864 865 866 867 868 869 870 | 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 | + + + + + + - + + - - - - - - - - + + + + + + + + + + + + | case 'u': count += ParseHex(p+1, (numBytes > 5) ? 4 : numBytes-2, &result); if (count == 2) { /* * No hexdigits -> This is just "u". */ result = 'u'; #if TCL_UTF_MAX > 3 } else if ((result & 0xF800) == 0xD800) { result = 0xFFFD; #else } else if ((result & 0xFC00) == 0xDC00) { result = 0xFFFD; |
︙ |
Changes to generic/tclUtf.c.
︙ | |||
64 65 66 67 68 69 70 | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | - + - + - - - - - - | 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* Tcl_UtfCharComplete() might point to 2nd byte of valid 4-byte sequence */ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, /* End of "continuation byte section" */ |
︙ | |||
130 131 132 133 134 135 136 | 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | return 2; } if (((unsigned)(ch - 0x10000) <= 0xFFFFF)) { return 4; } return 3; } |
︙ | |||
497 498 499 500 501 502 503 504 505 506 507 508 509 510 | 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 | + + + | /* * Three-byte-character lead byte followed by two trail bytes. */ *chPtr = (((byte & 0x0F) << 12) | ((src[1] & 0x3F) << 6) | (src[2] & 0x3F)); if (*chPtr > 0x7FF) { if ((*chPtr & 0xF800) == 0xD800) { *chPtr = 0xFFFD; } return 3; } } /* * A three-byte-character lead-byte not followed by two trail-bytes * represents itself. |
︙ | |||
593 594 595 596 597 598 599 600 601 602 603 604 605 606 | 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 | + + + | /* * Three-byte-character lead byte followed by two trail bytes. */ *chPtr = (((byte & 0x0F) << 12) | ((src[1] & 0x3F) << 6) | (src[2] & 0x3F)); if (*chPtr > 0x7FF) { if ((*chPtr & 0xF800) == 0xD800) { *chPtr = 0xFFFD; } return 3; } } /* * A three-byte-character lead-byte not followed by two trail-bytes * represents itself. |
︙ | |||
962 963 964 965 966 967 968 | 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 | - - + + - - - - - - - - - - - - | *--------------------------------------------------------------------------- */ const char * Tcl_UtfNext( const char *src) /* The current location in the string. */ { |
︙ | |||
1021 1022 1023 1024 1025 1026 1027 | 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 | - - + + + - - - - - - + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - + + - - + + - + - - - - + + + + - - - - - - - - - - - - + + + + - - - + - - - - - - - - - - + - | * None. * *--------------------------------------------------------------------------- */ const char * Tcl_UtfPrev( |
︙ |
Changes to tests/encoding.test.
︙ | |||
34 35 36 37 38 39 40 | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | + - + | # Some tests require the testencoding command testConstraint testencoding [llength [info commands testencoding]] testConstraint testbytestring [llength [info commands testbytestring]] testConstraint teststringbytes [llength [info commands teststringbytes]] testConstraint exec [llength [info commands exec]] testConstraint testgetencpath [llength [info commands testgetencpath]] testConstraint tip389 [expr {[string length [format %c 0x10000]] eq 2}] |
︙ | |||
321 322 323 324 325 326 327 | 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 | - + - + - + - + - + - + - + - + - + - + - + - + | binary scan [teststringbytes $y] H* z set z } c080 test encoding-15.4 {UtfToUtfProc emoji character input} -body { set x \xED\xA0\xBD\xED\xB8\x82 set y [encoding convertfrom utf-8 \xED\xA0\xBD\xED\xB8\x82] list [string length $x] $y |
︙ | |||
408 409 410 411 412 413 414 | 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 | - + - + - - + + - - + + | list $val [format %x [scan $val %c]] } -result "\u4E4E 4e4e" test encoding-16.2 {Utf16ToUtfProc} -body { set val [encoding convertfrom utf-16 "\xD8\xD8\xDC\xDC"] list $val [format %x [scan $val %c]] } -result "\U460DC 460dc" test encoding-16.3 {Utf16ToUtfProc} -body { |
︙ |
Changes to tests/utf.test.
︙ | |||
17 18 19 20 21 22 23 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | - | catch [list package require -exact Tcltest [info patchlevel]] testConstraint ucs2 [expr {[format %c 0x010000] eq "\uFFFD"}] testConstraint fullutf [expr {[format %c 0x010000] ne "\uFFFD"}] testConstraint utf16 [expr {[string length [format %c 0x10000]] == 2}] testConstraint ucs4 [expr {[testConstraint fullutf] && [string length [format %c 0x10000]] == 1}] |
︙ | |||
49 50 51 52 53 54 55 | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | - + - + - + - + - - + + | test utf-1.3 {Tcl_UniCharToUtf: 2 byte sequences} testbytestring { expr {"\xE0" eq [testbytestring \xC3\xA0]} } 1 test utf-1.4 {Tcl_UniCharToUtf: 3 byte sequences} testbytestring { expr {"\u4E4E" eq [testbytestring \xE4\xB9\x8E]} } 1 test utf-1.5 {Tcl_UniCharToUtf: overflowed Tcl_UniChar} testbytestring { |
︙ | |||
100 101 102 103 104 105 106 | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | - + - + - - + + + + + + + + | } 1 test utf-2.6 {Tcl_UtfToUniChar: lead (3-byte) followed by 1 trail} testbytestring { string length [testbytestring \xE2\xA2] } 2 test utf-2.7 {Tcl_UtfToUniChar: lead (3-byte) followed by 2 trail} testbytestring { string length [testbytestring \xE4\xB9\x8E] } 1 |
︙ | |||
141 142 143 144 145 146 147 | 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | - + - + + + + | } 7 test utf-4.4 {Tcl_NumUtfChars: #x00} testnumutfchars { testnumutfchars \x00 } 1 test utf-4.5 {Tcl_NumUtfChars: zero length, calc len} testnumutfchars { testnumutfchars "" 0 } 0 |
︙ | |||
392 393 394 395 396 397 398 | 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 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 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 | - + - + - + - + - + - + - + - + - + - + - + + + + - + - - + + - - + + - + + + + | } 3 test utf-6.67 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext \u8820[testbytestring \xF8] } 3 test utf-6.68 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0\xA0]G } 1 |
︙ | |||
564 565 566 567 568 569 570 | 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 | - + - + - + - + - + - + | } 2 test utf-7.9.1 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF8\xA0\xA0\xA0] 3 } 2 test utf-7.9.2 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF8\xA0\xF8\xA0] 3 } 2 |
︙ | |||
605 606 607 608 609 610 611 | 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 | - + - + - + - + - + - - + + - - + + - + - - + + - + - - + + - + - + - - + + - + - + - + - + + + + - + - - + + - - + + - + - + - + - + - + - + - + + + + - - + + + + + + + + - + - + + + + - + - - + + - + - + - + - + + + + - + - + - - - - - + + + + + + + + - - + + - - + + - - + + - - - - - + + + + + - + + + + + + + + + + - + - + - + - + | testutfprev A[testbytestring \xD0\xA0\xA0\xA0] 3 } 1 test utf-7.12.2 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xD0\xA0\xF8\xA0] 3 } 1 test utf-7.13 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xA0\xA0] |
︙ | |||
892 893 894 895 896 897 898 | 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 | - + - + - + | string range \u4E4E\u25A\xFF\u543klmnop 1 5 } \u25A\xFF\u543kl test utf-9.3.0 {Tcl_UtfAtIndex: index = 0, Emoji} ucs2 { string range \uD83D\uDE00G 0 0 } \uD83D test utf-9.3.1 {Tcl_UtfAtIndex: index = 0, Emoji} ucs4 { string range \uD83D\uDE00G 0 0 |
︙ | |||
1302 1303 1304 1305 1306 1307 1308 | 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 | - + - - - - - - - - - | UniCharCaseCmpTest > aBcB abca UniCharCaseCmpTest < \uFFFF [format %c 0x10000] ucs4 UniCharCaseCmpTest < \uFFFF \U10000 {Uesc ucs4} UniCharCaseCmpTest > [format %c 0x10000] \uFFFF ucs4 UniCharCaseCmpTest > \U10000 \uFFFF {Uesc ucs4} |