Changes On Branch 76cc0911f3d958cb
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch bug-ed29806baf-8.6 Through [76cc0911f3] Excluding Merge-Ins

This is equivalent to a diff from b14b21b3aa to 76cc0911f3

2020-05-04
13:01
Merge 8.6 check-in: 1256ace951 user: jan.nijtmans tags: bug-ed29806baf-8.6
12:31
New internal function TclGetUCS4() only available when TCL_UTF_MAX=4. This fixes all "knownBug" test... check-in: 41517f0841 user: jan.nijtmans tags: core-8-6-branch
11:08
Merge 8.6 check-in: 76cc0911f3 user: jan.nijtmans tags: bug-ed29806baf-8.6
09:41
Merge 8.6 check-in: 2dd789a502 user: jan.nijtmans tags: core-8-branch
09:40
Merge 8.5 check-in: b14b21b3aa user: jan.nijtmans tags: core-8-6-branch
09:37
Test-case cleanup. Increase timeout a little bit in main.test, making Travis build errors because of... check-in: c6a5d8fca9 user: jan.nijtmans tags: core-8-5-branch
08:35
(partial) fix for [9d0cb35bb2]: Various issues with core-8-6-branch, TCL_UTF_MAX=4. (even though TCL... check-in: af513d6a16 user: jan.nijtmans tags: core-8-6-branch
2020-05-03
22:27
Merge 8.6 check-in: 0de2fe18d1 user: jan.nijtmans tags: bug-ed29806baf-8.6

Changes to generic/tclExecute.c.
5567
5568
5569
5570
5571
5572
5573
5574

5575
5576
5577
5578
5579
5580
5581
5582
5583

5584
5585
5586
5587
5588
5589
5590
5567
5568
5569
5570
5571
5572
5573

5574
5575
5576







5577
5578
5579
5580
5581
5582
5583
5584







-
+


-
-
-
-
-
-
-
+







	} else if (TclIsPureByteArray(valuePtr)) {
	    objResultPtr = Tcl_NewByteArrayObj(
		    Tcl_GetByteArrayFromObj(valuePtr, NULL)+index, 1);
	} else if (valuePtr->bytes && length == valuePtr->length) {
	    objResultPtr = Tcl_NewStringObj((const char *)
		    valuePtr->bytes+index, 1);
	} else {
	    char buf[4] = "";
	    char buf[8] = "";
	    Tcl_UniChar ch = Tcl_GetUniChar(valuePtr, index);

	    /*
	     * This could be: Tcl_NewUnicodeObj((const Tcl_UniChar *)&ch, 1)
	     * but creating the object as a string seems to be faster in
	     * practical use.
	     */

	    length = Tcl_UniCharToUtf(ch, buf);
	    length = TclUCS4ToUtf(ch, buf);
	    objResultPtr = Tcl_NewStringObj(buf, length);
	}

	TRACE_APPEND(("\"%s\"\n", O2S(objResultPtr)));
	NEXT_INST_F(1, 2, 1);

    case INST_STR_RANGE:
Changes to generic/tclUtf.c.
60
61
62
63
64
65
66






67














68
69
70
71
72
73
74
75
76

77
78
79
80
81
82
83
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
91
92
93
94

95
96
97
98
99
100
101
102







+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+








-
+







 */

static const unsigned char totalBytes[256] = {
    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,
    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" */
    2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
    3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
#if TCL_UTF_MAX != 4
#if TCL_UTF_MAX > 3
    4,4,4,4,4,
#else
    1,1,1,1,1,
#endif
    1,1,1,1,1,1,1,1,1,1,1
};

static const unsigned char complete[256] = {
    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,
    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,
#if TCL_UTF_MAX > 4
    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,
#else /* 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,
#endif
    2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
    3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
#if TCL_UTF_MAX > 3
#if TCL_UTF_MAX > 4
    4,4,4,4,4,
#else
    1,1,1,1,1,
#endif
    1,1,1,1,1,1,1,1,1,1,1
};

553
554
555
556
557
558
559
560

561
562
563
564
565
566
567
572
573
574
575
576
577
578

579
580
581
582
583
584
585
586







-
+








int
Tcl_UtfCharComplete(
    const char *src,		/* String to check if first few bytes contain
				 * a complete UTF-8 character. */
    int length)			/* Length of above string in bytes. */
{
    return length >= totalBytes[UCHAR(*src)];
    return length >= complete[UCHAR(*src)];
}

/*
 *---------------------------------------------------------------------------
 *
 * Tcl_NumUtfChars --
 *
Changes to tests/utf.test.
393
394
395
396
397
398
399
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
393
394
395
396
397
398
399

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







-
+

















-
+





-
+





-
+





-
+





-
+





-
+







} 3
test utf-6.68 {Tcl_UtfNext} testutfnext {
    testutfnext \xF2\xA0\xA0G
} 1
test utf-6.69.0 {Tcl_UtfNext} {testutfnext ucs2} {
    testutfnext \xF2\xA0\xA0\xA0
} 1
test utf-6.69.1 {Tcl_UtfNext} {testutfnext fullutf} {
test utf-6.69.1 {Tcl_UtfNext} {testutfnext ucs4} {
    testutfnext \xF2\xA0\xA0\xA0
} 4
test utf-6.70 {Tcl_UtfNext} testutfnext {
    testutfnext \xF2\xA0\xA0\xD0
} 1
test utf-6.71 {Tcl_UtfNext} testutfnext {
    testutfnext \xF2\xA0\xA0\xE8
} 1
test utf-6.72 {Tcl_UtfNext} testutfnext {
    testutfnext \xF2\xA0\xA0\xF2
} 1
test utf-6.73 {Tcl_UtfNext} testutfnext {
    testutfnext \xF2\xA0\xA0\xF8
} 1
test utf-6.74.0 {Tcl_UtfNext} {testutfnext ucs2} {
    testutfnext \xF2\xA0\xA0\xA0G
} 1
test utf-6.74.1 {Tcl_UtfNext} {testutfnext fullutf} {
test utf-6.74.1 {Tcl_UtfNext} {testutfnext ucs4} {
    testutfnext \xF2\xA0\xA0\xA0G
} 4
test utf-6.75.0 {Tcl_UtfNext} {testutfnext ucs2} {
    testutfnext \xF2\xA0\xA0\xA0\xA0
} 1
test utf-6.75.1 {Tcl_UtfNext} {testutfnext fullutf} {
test utf-6.75.1 {Tcl_UtfNext} {testutfnext ucs4} {
    testutfnext \xF2\xA0\xA0\xA0\xA0
} 4
test utf-6.76.0 {Tcl_UtfNext} {testutfnext ucs2} {
    testutfnext \xF2\xA0\xA0\xA0\xD0
} 1
test utf-6.76.1 {Tcl_UtfNext} {testutfnext fullutf} {
test utf-6.76.1 {Tcl_UtfNext} {testutfnext ucs4} {
    testutfnext \xF2\xA0\xA0\xA0\xD0
} 4
test utf-6.77.0 {Tcl_UtfNext} {testutfnext ucs2} {
    testutfnext \xF2\xA0\xA0\xA0\xE8
} 1
test utf-6.77.1 {Tcl_UtfNext} {testutfnext fullutf} {
test utf-6.77.1 {Tcl_UtfNext} {testutfnext ucs4} {
    testutfnext \xF2\xA0\xA0\xA0\xE8
} 4
test utf-6.78.0 {Tcl_UtfNext} {testutfnext ucs2} {
    testutfnext \xF2\xA0\xA0\xA0\xF2
} 1
test utf-6.78.1 {Tcl_UtfNext} {testutfnext fullutf} {
test utf-6.78.1 {Tcl_UtfNext} {testutfnext ucs4} {
    testutfnext \xF2\xA0\xA0\xA0\xF2
} 4
test utf-6.79.0 {Tcl_UtfNext} {testutfnext ucs2} {
    testutfnext \xF2\xA0\xA0\xA0G\xF8
} 1
test utf-6.79.1 {Tcl_UtfNext} {testutfnext fullutf} {
test utf-6.79.1 {Tcl_UtfNext} {testutfnext ucs4} {
    testutfnext \xF2\xA0\xA0\xA0G\xF8
} 4
test utf-6.80 {Tcl_UtfNext - overlong sequences} testutfnext {
    testutfnext \xC0\x80
} 2
test utf-6.81 {Tcl_UtfNext - overlong sequences} testutfnext {
    testutfnext \xC0\x81
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
516
517
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

516
517
518
519
520
521
522
523







-
+











-
+








-
+


+
+
+


-
+



-
+


+
+
+


-
+







} 3
test utf-6.86 {Tcl_UtfNext - overlong sequences} testutfnext {
    testutfnext \xF0\x80\x80\x80
} 1
test utf-6.87.0 {Tcl_UtfNext - overlong sequences} {testutfnext ucs2} {
    testutfnext \xF0\x90\x80\x80
} 1
test utf-6.87.1 {Tcl_UtfNext - overlong sequences} {testutfnext fullutf} {
test utf-6.87.1 {Tcl_UtfNext - overlong sequences} {testutfnext ucs4} {
    testutfnext \xF0\x90\x80\x80
} 4
test utf-6.88 {Tcl_UtfNext, pointing to 2th byte of 3-byte valid sequence} testutfnext {
    testutfnext \xA0\xA0
} 1
test utf-6.89 {Tcl_UtfNext, pointing to 2th byte of 3-byte invalid sequence} testutfnext {
    testutfnext \x80\x80
} 1
test utf-6.90.0 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext ucs2} {
    testutfnext \xF4\x8F\xBF\xBF
} 1
test utf-6.90.1 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext fullutf} {
test utf-6.90.1 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext ucs4} {
    testutfnext \xF4\x8F\xBF\xBF
} 4
test utf-6.91.0 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext ucs2} {
    testutfnext \xF4\x90\x80\x80
} 1
test utf-6.91.1 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext fullutf} {
    testutfnext \xF4\x90\x80\x80
} 1
test utf-6.92 {Tcl_UtfNext, pointing to 2th byte of 4-byte valid sequence} testutfnext {
test utf-6.92.0 {Tcl_UtfNext, pointing to 2th byte of 4-byte valid sequence} {testutfnext ucs2} {
    testutfnext \xA0\xA0\xA0
} 1
test utf-6.92.1 {Tcl_UtfNext, pointing to 2th byte of 4-byte valid sequence} {testutfnext fullutf knownBug} {
    testutfnext \xA0\xA0\xA0
} 3
test utf-6.93.0 {Tcl_UtfNext, pointing to 2th byte of 4-byte invalid sequence} {testutfnext ucs2} {
    testutfnext \x80\x80\x80
} 1
} 3
test utf-6.93.1 {Tcl_UtfNext, pointing to 2th byte of 4-byte invalid sequence} {testutfnext fullutf knownBug} {
    testutfnext \x80\x80\x80
} 3
test utf-6.94 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} testutfnext {
test utf-6.94.0 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} {testutfnext ucs2} {
    testutfnext \xA0\xA0\xA0\xA0
} 1
test utf-6.94.1 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} {testutfnext fullutf knownBug} {
    testutfnext \xA0\xA0\xA0\xA0
} 3
test utf-6.95 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} {testutfnext ucs2} {
    testutfnext \x80\x80\x80\x80
} 1
} 3
test utf-6.96 {Tcl_UtfNext, read limits} testutfnext {
    testutfnext G 0
} 0
test utf-6.97 {Tcl_UtfNext, read limits} testutfnext {
    testutfnext \xA0 0
} 0
test utf-6.98 {Tcl_UtfNext, read limits} testutfnext {
549
550
551
552
553
554
555
556

557
558
559
560
561
562

563
564
565
566
567
568

569
570
571
572
573
574

575
576
577
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
608
609

610
611
612

613
614
615
616


617
618
619

620
621
622

623
624
625

626
627
628
629
630
631
632
555
556
557
558
559
560
561

562
563
564
565
566
567

568
569
570
571
572
573

574
575
576
577
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
608
609
610
611

612
613
614

615
616
617

618
619
620


621
622
623
624

625
626
627

628
629
630

631
632
633
634
635
636
637
638







-
+





-
+





-
+





-
+





-
+





-
+





-
+





-
+







-
+


-
+


-
+


-
-
+
+


-
+


-
+


-
+







} 0
test utf-6.109 {Tcl_UtfNext, read limits} testutfnext {
    testutfnext \xE8\xA0\xA0\xA0 3
} 3
test utf-6.110.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
    testutfnext \xF2\xA0\xA0\xA0G 1
} 1
test utf-6.110.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} {
test utf-6.110.1 {Tcl_UtfNext, read limits} {testutfnext ucs4} {
    testutfnext \xF2\xA0\xA0\xA0G 1
} 0
test utf-6.111.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
    testutfnext \xF2\xA0\xA0\xA0G 2
} 1
test utf-6.111.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} {
test utf-6.111.1 {Tcl_UtfNext, read limits} {testutfnext ucs4} {
    testutfnext \xF2\xA0\xA0\xA0G 2
} 0
test utf-6.112.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
    testutfnext \xF2\xA0\xA0\xA0G 3
} 1
test utf-6.112.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} {
test utf-6.112.1 {Tcl_UtfNext, read limits} {testutfnext ucs4} {
    testutfnext \xF2\xA0\xA0\xA0G 3
} 0
test utf-6.113.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
    testutfnext \xF2\xA0\xA0\xA0G 4
} 1
test utf-6.113.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} {
test utf-6.113.1 {Tcl_UtfNext, read limits} {testutfnext ucs4} {
    testutfnext \xF2\xA0\xA0\xA0G 4
} 4
test utf-6.114.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
    testutfnext \xF2\xA0\xA0\xA0\xA0 1
} 1
test utf-6.114.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} {
test utf-6.114.1 {Tcl_UtfNext, read limits} {testutfnext ucs4} {
    testutfnext \xF2\xA0\xA0\xA0\xA0 1
} 0
test utf-6.115.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
    testutfnext \xF2\xA0\xA0\xA0\xA0 2
} 1
test utf-6.115.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} {
test utf-6.115.1 {Tcl_UtfNext, read limits} {testutfnext ucs4} {
    testutfnext \xF2\xA0\xA0\xA0\xA0 2
} 0
test utf-6.116.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
    testutfnext \xF2\xA0\xA0\xA0\xA0 3
} 1
test utf-6.116.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} {
test utf-6.116.1 {Tcl_UtfNext, read limits} {testutfnext ucs4} {
    testutfnext \xF2\xA0\xA0\xA0\xA0 3
} 0
test utf-6.117.0 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
    testutfnext \xF2\xA0\xA0\xA0\xA0 4
} 1
test utf-6.117.1 {Tcl_UtfNext, read limits} {testutfnext fullutf} {
test utf-6.117.1 {Tcl_UtfNext, read limits} {testutfnext ucs4} {
    testutfnext \xF2\xA0\xA0\xA0\xA0 4
} 4
test utf-6.118 {Tcl_UtfNext, read limits} testutfnext {
    testutfnext \xA0G 0
} 0
test utf-6.119 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
    testutfnext \xA0G 1
} 1
} 0
test utf-6.120 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
    testutfnext \xA0\xA0 1
} 1
} 0
test utf-6.121 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
    testutfnext \xA0\xA0G 2
} 1
} 0
test utf-6.122 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
    testutfnext \xA0\xA0\xA0 2
} 1
test utf-6.123 {Tcl_UtfNext, read limits} testutfnext {
} 0
test utf-6.123 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
    testutfnext \xA0\xA0\xA0G 3
} 1
test utf-6.124 {Tcl_UtfNext, read limits} testutfnext {
test utf-6.124 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
    testutfnext \xA0\xA0\xA0\xA0 3
} 1
test utf-6.125 {Tcl_UtfNext, read limits} testutfnext {
test utf-6.125 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
    testutfnext \xA0\xA0\xA0\xA0G 4
} 1
test utf-6.126 {Tcl_UtfNext, read limits} testutfnext {
test utf-6.126 {Tcl_UtfNext, read limits} {testutfnext ucs2} {
    testutfnext \xA0\xA0\xA0\xA0\xA0 4
} 1

test utf-7.1 {Tcl_UtfPrev} testutfprev {
    testutfprev {}
} 0
test utf-7.2 {Tcl_UtfPrev} testutfprev {
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
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







-
+





-
+





-
+







} 2
test utf-7.9.2 {Tcl_UtfPrev} testutfprev {
    testutfprev A\xF8\xA0\xF8\xA0 3
} 2
test utf-7.10.0 {Tcl_UtfPrev} {testutfprev ucs2} {
    testutfprev A\xF2\xA0
} 2
test utf-7.10.1 {Tcl_UtfPrev} {testutfprev fullutf} {
test utf-7.10.1 {Tcl_UtfPrev} {testutfprev ucs4} {
    testutfprev A\xF2\xA0
} 1
test utf-7.10.2 {Tcl_UtfPrev} {testutfprev ucs2} {
    testutfprev A\xF2\xA0\xA0\xA0 3
} 2
test utf-7.10.3 {Tcl_UtfPrev} {testutfprev fullutf} {
test utf-7.10.3 {Tcl_UtfPrev} {testutfprev ucs4} {
    testutfprev A\xF2\xA0\xA0\xA0 3
} 1
test utf-7.10.4 {Tcl_UtfPrev} {testutfprev ucs2} {
    testutfprev A\xF2\xA0\xF8\xA0 3
} 2
test utf-7.10.5 {Tcl_UtfPrev} {testutfprev fullutf} {
test utf-7.10.5 {Tcl_UtfPrev} {testutfprev ucs4} {
    testutfprev A\xF2\xA0\xF8\xA0 3
} 1
test utf-7.11 {Tcl_UtfPrev} testutfprev {
    testutfprev A\xE8\xA0
} 1
test utf-7.11.1 {Tcl_UtfPrev} testutfprev {
    testutfprev A\xE8\xA0\xA0\xA0 3
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
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







-
+





-
+





-
+







} 3
test utf-7.14.2 {Tcl_UtfPrev} testutfprev {
    testutfprev A\xF8\xA0\xA0\xF8 4
} 3
test utf-7.15.0 {Tcl_UtfPrev} {testutfprev ucs2} {
    testutfprev A\xF2\xA0\xA0
} 3
test utf-7.15.1 {Tcl_UtfPrev} {testutfprev fullutf} {
test utf-7.15.1 {Tcl_UtfPrev} {testutfprev ucs4} {
    testutfprev A\xF2\xA0\xA0
} 1
test utf-7.15.1.0 {Tcl_UtfPrev} {testutfprev ucs2} {
    testutfprev A\xF2\xA0\xA0\xA0 4
} 3
test utf-7.15.1.1 {Tcl_UtfPrev} {testutfprev fullutf} {
test utf-7.15.1.1 {Tcl_UtfPrev} {testutfprev ucs4} {
    testutfprev A\xF2\xA0\xA0\xA0 4
} 1
test utf-7.15.2.0 {Tcl_UtfPrev} {testutfprev ucs2} {
    testutfprev A\xF2\xA0\xA0\xF8 4
} 3
test utf-7.15.2.1 {Tcl_UtfPrev} {testutfprev fullutf} {
test utf-7.15.2.1 {Tcl_UtfPrev} {testutfprev ucs4} {
    testutfprev A\xF2\xA0\xA0\xF8 4
} 1
test utf-7.16 {Tcl_UtfPrev} testutfprev {
    testutfprev A\xE8\xA0\xA0
} 1
test utf-7.16.1 {Tcl_UtfPrev} testutfprev {
    testutfprev A\xE8\xA0\xA0\xA0 4
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
908
909
889
890
891
892
893
894
895

896
897
898
899
900
901

902
903
904
905
906
907

908
909
910
911
912
913
914
915







-
+





-
+





-
+







} 1
test utf-7.38 {Tcl_UtfPrev -- overlong sequence}  testutfprev {
    testutfprev A\xE0\xA0\x80 2
} 1
test utf-7.39.0 {Tcl_UtfPrev -- overlong sequence}  {testutfprev ucs2} {
    testutfprev A\xF0\x90\x80\x80
} 2
test utf-7.39.1 {Tcl_UtfPrev -- overlong sequence}  {testutfprev fullutf} {
test utf-7.39.1 {Tcl_UtfPrev -- overlong sequence}  {testutfprev ucs4} {
    testutfprev A\xF0\x90\x80\x80
} 1
test utf-7.40.0 {Tcl_UtfPrev -- overlong sequence}  {testutfprev ucs2} {
    testutfprev A\xF0\x90\x80\x80 4
} 3
test utf-7.40.1 {Tcl_UtfPrev -- overlong sequence}  {testutfprev fullutf} {
test utf-7.40.1 {Tcl_UtfPrev -- overlong sequence}  {testutfprev ucs4} {
    testutfprev A\xF0\x90\x80\x80 4
} 1
test utf-7.41.0 {Tcl_UtfPrev -- overlong sequence}  {testutfprev ucs2} {
    testutfprev A\xF0\x90\x80\x80 3
} 2
test utf-7.41.1 {Tcl_UtfPrev -- overlong sequence}  {testutfprev fullutf} {
test utf-7.41.1 {Tcl_UtfPrev -- overlong sequence}  {testutfprev ucs4} {
    testutfprev A\xF0\x90\x80\x80 3
} 1
test utf-7.42 {Tcl_UtfPrev -- overlong sequence}  testutfprev {
    testutfprev A\xF0\x90\x80\x80 2
} 1
test utf-7.43 {Tcl_UtfPrev -- no lead byte at start}  testutfprev {
    testutfprev \xA0
928
929
930
931
932
933
934
935

936
937
938
939
940
941

942
943
944
945
946
947

948
949
950
951
952
953
954
934
935
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







-
+





-
+





-
+







} 0
test utf-7.47.2 {Tcl_UtfPrev, pointing to 3th byte of 3-byte invalid sequence} testutfprev {
    testutfprev \xE8\xA0\x00 2
} 0
test utf-7.48.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs2} {
    testutfprev A\xF4\x8F\xBF\xBF
} 2
test utf-7.48.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev fullutf} {
test utf-7.48.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs4} {
    testutfprev A\xF4\x8F\xBF\xBF
} 1
test utf-7.48.2 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs2} {
    testutfprev A\xF4\x8F\xBF\xBF 4
} 3
test utf-7.48.3 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev fullutf} {
test utf-7.48.3 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs4} {
    testutfprev A\xF4\x8F\xBF\xBF 4
} 1
test utf-7.48.4 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs2} {
    testutfprev A\xF4\x8F\xBF\xBF 3
} 2
test utf-7.48.5 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev fullutf} {
test utf-7.48.5 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs4} {
    testutfprev A\xF4\x8F\xBF\xBF 3
} 1
test utf-7.48.6 {Tcl_UtfPrev, validity check [493dccc2de]} testutfprev {
    testutfprev A\xF4\x8F\xBF\xBF 2
} 1
test utf-7.49.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev ucs2} {
    testutfprev A\xF4\x90\x80\x80
983
984
985
986
987
988
989
990

991
992
993

994
995
996
997
998
999
1000
989
990
991
992
993
994
995

996
997
998

999
1000
1001
1002
1003
1004
1005
1006







-
+


-
+







} c
test utf-8.4 {Tcl_UniCharAtIndex: index > 0} {
    string index \u4E4E\u25A\xFF\u543 2
} \uFF
test utf-8.5.0 {Tcl_UniCharAtIndex: high surrogate} ucs2 {
    string index \uD842 0
} \uD842
test utf-8.5.1 {Tcl_UniCharAtIndex: high surrogate} {ucs4 knownBug} {
test utf-8.5.1 {Tcl_UniCharAtIndex: high surrogate} ucs4 {
    string index \uD842 0
} \uD842
test utf-8.5.2 {Tcl_UniCharAtIndex: high surrogate} {tip389 knownBug} {
test utf-8.5.2 {Tcl_UniCharAtIndex: high surrogate} tip389 {
    string index \uD842 0
} \uD842
test utf-8.6 {Tcl_UniCharAtIndex: low surrogate} {
    string index \uDC42 0
} \uDC42
test utf-8.7.0 {Tcl_UniCharAtIndex: Emoji} ucs2 {
    string index \uD83D\uDE00G 0
1178
1179
1180
1181
1182
1183
1184
1185

1186
1187
1188
1189
1190
1191
1192
1184
1185
1186
1187
1188
1189
1190

1191
1192
1193
1194
1195
1196
1197
1198







-
+







bsCheck \uk	117
bsCheck \u41	65
bsCheck \ua	10
bsCheck \uA	10
bsCheck \340	224
bsCheck \uA1	161
bsCheck \u4E21	20001
bsCheck \741    225	pre388	;# == \341
bsCheck \741    225	pre388	;# == \341 
bsCheck \741    60	!pre388	;# == \74 1
bsCheck \U      85
bsCheck \Uk     85
bsCheck \U41    65			Uesc
bsCheck \Ua     10			Uesc
bsCheck \UA     10			Uesc
bsCheck \UA1    161			Uesc
1340
1341
1342
1343
1344
1345
1346
1347

1348
1349
1350
1351
1352
1353
1354
1346
1347
1348
1349
1350
1351
1352

1353
1354
1355
1356
1357
1358
1359
1360







-
+







    string compare [string range [format %c 0xFFFF] 0 0] [string range [format %c 0x10000] 0 0]
} -1
test utf-20.2 {[4c591fa487] TclUniCharNcmp/TclUtfNcmp} knownBug {
    set one [format %c 0xFFFF]
    set two [format %c 0x10000]
    set first [string compare $one $two]
    string range $one 0 0
    string range $two 0 0
    string range $two 0 0 
    set second [string compare $one $two]
    expr {($first == $second) ? "agree" : "disagree"}
} agree

test utf-21.1 {TclUniCharIsAlnum} {
    # this returns 1 with Unicode 7 compliance
    string is alnum \u1040\u021F\u0220
1462
1463
1464
1465
1466
1467
1468
1469

1470
1471

1472
1473
1474
1475
1476
1477
1478
1468
1469
1470
1471
1472
1473
1474

1475
1476

1477
1478
1479
1480
1481
1482
1483
1484







-
+

-
+







    incr count
}
variable count 1
UniCharCaseCmpTest < a b
UniCharCaseCmpTest > b a
UniCharCaseCmpTest > B a
UniCharCaseCmpTest > aBcB abca
UniCharCaseCmpTest < \uFFFF [format %c 0x10000] ucs4
UniCharCaseCmpTest < \uFFFF [format %c 0x10000] ucs4	
UniCharCaseCmpTest < \uFFFF \U10000		{Uesc ucs4}
UniCharCaseCmpTest > [format %c 0x10000] \uFFFF	ucs4
UniCharCaseCmpTest > [format %c 0x10000] \uFFFF	ucs4	
UniCharCaseCmpTest > \U10000 \uFFFF		{Uesc ucs4}





unset count