Tcl Source Code

Hex Artifact Content
Login

Artifact b7a8d0dbc9b5df6e266975be754f1af1b407f7ff293ab6b368604db86cb65dfc:


0000: 23 20 54 68 69 73 20 66 69 6c 65 20 63 6f 6e 74  # This file cont
0010: 61 69 6e 73 20 61 20 63 6f 6c 6c 65 63 74 69 6f  ains a collectio
0020: 6e 20 6f 66 20 74 65 73 74 73 20 66 6f 72 20 74  n of tests for t
0030: 63 6c 55 74 66 2e 63 0a 23 20 53 6f 75 72 63 69  clUtf.c.# Sourci
0040: 6e 67 20 74 68 69 73 20 66 69 6c 65 20 69 6e 74  ng this file int
0050: 6f 20 54 63 6c 20 72 75 6e 73 20 74 68 65 20 74  o Tcl runs the t
0060: 65 73 74 73 20 61 6e 64 20 67 65 6e 65 72 61 74  ests and generat
0070: 65 73 20 6f 75 74 70 75 74 20 66 6f 72 0a 23 20  es output for.# 
0080: 65 72 72 6f 72 73 2e 20 20 4e 6f 20 6f 75 74 70  errors.  No outp
0090: 75 74 20 6d 65 61 6e 73 20 6e 6f 20 65 72 72 6f  ut means no erro
00a0: 72 73 20 77 65 72 65 20 66 6f 75 6e 64 2e 0a 23  rs were found..#
00b0: 0a 23 20 43 6f 70 79 72 69 67 68 74 20 28 63 29  .# Copyright (c)
00c0: 20 31 39 39 37 20 53 75 6e 20 4d 69 63 72 6f 73   1997 Sun Micros
00d0: 79 73 74 65 6d 73 2c 20 49 6e 63 2e 0a 23 20 43  ystems, Inc..# C
00e0: 6f 70 79 72 69 67 68 74 20 28 63 29 20 31 39 39  opyright (c) 199
00f0: 38 2d 31 39 39 39 20 62 79 20 53 63 72 69 70 74  8-1999 by Script
0100: 69 63 73 20 43 6f 72 70 6f 72 61 74 69 6f 6e 2e  ics Corporation.
0110: 0a 23 0a 23 20 53 65 65 20 74 68 65 20 66 69 6c  .#.# See the fil
0120: 65 20 22 6c 69 63 65 6e 73 65 2e 74 65 72 6d 73  e "license.terms
0130: 22 20 66 6f 72 20 69 6e 66 6f 72 6d 61 74 69 6f  " for informatio
0140: 6e 20 6f 6e 20 75 73 61 67 65 20 61 6e 64 20 72  n on usage and r
0150: 65 64 69 73 74 72 69 62 75 74 69 6f 6e 0a 23 20  edistribution.# 
0160: 6f 66 20 74 68 69 73 20 66 69 6c 65 2c 20 61 6e  of this file, an
0170: 64 20 66 6f 72 20 61 20 44 49 53 43 4c 41 49 4d  d for a DISCLAIM
0180: 45 52 20 4f 46 20 41 4c 4c 20 57 41 52 52 41 4e  ER OF ALL WARRAN
0190: 54 49 45 53 2e 0a 0a 69 66 20 7b 5b 6c 73 65 61  TIES...if {[lsea
01a0: 72 63 68 20 5b 6e 61 6d 65 73 70 61 63 65 20 63  rch [namespace c
01b0: 68 69 6c 64 72 65 6e 5d 20 3a 3a 74 63 6c 74 65  hildren] ::tclte
01c0: 73 74 5d 20 3d 3d 20 2d 31 7d 20 7b 0a 20 20 20  st] == -1} {.   
01d0: 20 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65   package require
01e0: 20 74 63 6c 74 65 73 74 20 32 0a 20 20 20 20 6e   tcltest 2.    n
01f0: 61 6d 65 73 70 61 63 65 20 69 6d 70 6f 72 74 20  amespace import 
0200: 2d 66 6f 72 63 65 20 3a 3a 74 63 6c 74 65 73 74  -force ::tcltest
0210: 3a 3a 2a 0a 7d 0a 0a 6e 61 6d 65 73 70 61 63 65  ::*.}..namespace
0220: 20 70 61 74 68 20 3a 3a 74 63 6c 3a 3a 6d 61 74   path ::tcl::mat
0230: 68 6f 70 0a 0a 3a 3a 74 63 6c 74 65 73 74 3a 3a  hop..::tcltest::
0240: 6c 6f 61 64 54 65 73 74 65 64 43 6f 6d 6d 61 6e  loadTestedComman
0250: 64 73 0a 63 61 74 63 68 20 5b 6c 69 73 74 20 70  ds.catch [list p
0260: 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 2d  ackage require -
0270: 65 78 61 63 74 20 54 63 6c 74 65 73 74 20 5b 69  exact Tcltest [i
0280: 6e 66 6f 20 70 61 74 63 68 6c 65 76 65 6c 5d 5d  nfo patchlevel]]
0290: 0a 0a 74 65 73 74 43 6f 6e 73 74 72 61 69 6e 74  ..testConstraint
02a0: 20 75 63 73 32 20 5b 65 78 70 72 20 7b 5b 66 6f   ucs2 [expr {[fo
02b0: 72 6d 61 74 20 25 63 20 30 78 30 31 30 30 30 30  rmat %c 0x010000
02c0: 5d 20 65 71 20 22 5c 75 46 46 46 44 22 7d 5d 0a  ] eq "\uFFFD"}].
02d0: 74 65 73 74 43 6f 6e 73 74 72 61 69 6e 74 20 66  testConstraint f
02e0: 75 6c 6c 75 74 66 20 5b 65 78 70 72 20 7b 5b 66  ullutf [expr {[f
02f0: 6f 72 6d 61 74 20 25 63 20 30 78 30 31 30 30 30  ormat %c 0x01000
0300: 30 5d 20 6e 65 20 22 5c 75 46 46 46 44 22 7d 5d  0] ne "\uFFFD"}]
0310: 0a 74 65 73 74 43 6f 6e 73 74 72 61 69 6e 74 20  .testConstraint 
0320: 74 69 70 33 38 39 20 5b 65 78 70 72 20 7b 5b 73  tip389 [expr {[s
0330: 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 5b 66 6f  tring length [fo
0340: 72 6d 61 74 20 25 63 20 30 78 31 30 30 30 30 5d  rmat %c 0x10000]
0350: 5d 20 65 71 20 32 7d 5d 0a 74 65 73 74 43 6f 6e  ] eq 2}].testCon
0360: 73 74 72 61 69 6e 74 20 75 63 73 34 20 5b 65 78  straint ucs4 [ex
0370: 70 72 20 7b 5b 74 65 73 74 43 6f 6e 73 74 72 61  pr {[testConstra
0380: 69 6e 74 20 66 75 6c 6c 75 74 66 5d 0a 09 09 26  int fullutf]...&
0390: 26 20 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 68  & [string length
03a0: 20 5b 66 6f 72 6d 61 74 20 25 63 20 30 78 31 30   [format %c 0x10
03b0: 30 30 30 5d 5d 20 3d 3d 20 31 7d 5d 0a 0a 74 65  000]] == 1}]..te
03c0: 73 74 43 6f 6e 73 74 72 61 69 6e 74 20 55 65 73  stConstraint Ues
03d0: 63 20 5b 65 71 20 5c 55 30 30 34 31 20 41 5d 0a  c [eq \U0041 A].
03e0: 74 65 73 74 43 6f 6e 73 74 72 61 69 6e 74 20 70  testConstraint p
03f0: 72 65 33 38 38 20 5b 65 71 20 5c 78 37 34 31 20  re388 [eq \x741 
0400: 41 5d 0a 74 65 73 74 43 6f 6e 73 74 72 61 69 6e  A].testConstrain
0410: 74 20 70 61 69 72 73 54 6f 34 62 79 74 65 73 20  t pairsTo4bytes 
0420: 5b 65 78 70 72 20 7b 5b 6c 6c 65 6e 67 74 68 20  [expr {[llength 
0430: 5b 69 6e 66 6f 20 63 6f 6d 6d 61 6e 64 73 20 74  [info commands t
0440: 65 73 74 73 74 72 69 6e 67 62 79 74 65 73 5d 5d  eststringbytes]]
0450: 0a 09 09 26 26 20 5b 73 74 72 69 6e 67 20 6c 65  ...&& [string le
0460: 6e 67 74 68 20 5b 74 65 73 74 73 74 72 69 6e 67  ngth [teststring
0470: 62 79 74 65 73 20 5c 75 44 38 33 44 5c 75 44 43  bytes \uD83D\uDC
0480: 41 39 5d 5d 20 3d 3d 20 34 7d 5d 0a 0a 74 65 73  A9]] == 4}]..tes
0490: 74 43 6f 6e 73 74 72 61 69 6e 74 20 74 65 73 74  tConstraint test
04a0: 62 79 74 65 73 74 72 69 6e 67 20 5b 6c 6c 65 6e  bytestring [llen
04b0: 67 74 68 20 5b 69 6e 66 6f 20 63 6f 6d 6d 61 6e  gth [info comman
04c0: 64 73 20 74 65 73 74 62 79 74 65 73 74 72 69 6e  ds testbytestrin
04d0: 67 5d 5d 0a 74 65 73 74 43 6f 6e 73 74 72 61 69  g]].testConstrai
04e0: 6e 74 20 74 65 73 74 66 69 6e 64 66 69 72 73 74  nt testfindfirst
04f0: 20 5b 6c 6c 65 6e 67 74 68 20 5b 69 6e 66 6f 20   [llength [info 
0500: 63 6f 6d 6d 61 6e 64 73 20 74 65 73 74 66 69 6e  commands testfin
0510: 64 66 69 72 73 74 5d 5d 0a 74 65 73 74 43 6f 6e  dfirst]].testCon
0520: 73 74 72 61 69 6e 74 20 74 65 73 74 66 69 6e 64  straint testfind
0530: 6c 61 73 74 20 5b 6c 6c 65 6e 67 74 68 20 5b 69  last [llength [i
0540: 6e 66 6f 20 63 6f 6d 6d 61 6e 64 73 20 74 65 73  nfo commands tes
0550: 74 66 69 6e 64 6c 61 73 74 5d 5d 0a 74 65 73 74  tfindlast]].test
0560: 43 6f 6e 73 74 72 61 69 6e 74 20 74 65 73 74 6e  Constraint testn
0570: 75 6d 75 74 66 63 68 61 72 73 20 5b 6c 6c 65 6e  umutfchars [llen
0580: 67 74 68 20 5b 69 6e 66 6f 20 63 6f 6d 6d 61 6e  gth [info comman
0590: 64 73 20 74 65 73 74 6e 75 6d 75 74 66 63 68 61  ds testnumutfcha
05a0: 72 73 5d 5d 0a 74 65 73 74 43 6f 6e 73 74 72 61  rs]].testConstra
05b0: 69 6e 74 20 74 65 73 74 73 74 72 69 6e 67 6f 62  int teststringob
05c0: 6a 20 5b 6c 6c 65 6e 67 74 68 20 5b 69 6e 66 6f  j [llength [info
05d0: 20 63 6f 6d 6d 61 6e 64 73 20 74 65 73 74 73 74   commands testst
05e0: 72 69 6e 67 6f 62 6a 5d 5d 0a 74 65 73 74 43 6f  ringobj]].testCo
05f0: 6e 73 74 72 61 69 6e 74 20 74 65 73 74 75 74 66  nstraint testutf
0600: 6e 65 78 74 20 5b 6c 6c 65 6e 67 74 68 20 5b 69  next [llength [i
0610: 6e 66 6f 20 63 6f 6d 6d 61 6e 64 73 20 74 65 73  nfo commands tes
0620: 74 75 74 66 6e 65 78 74 5d 5d 0a 74 65 73 74 43  tutfnext]].testC
0630: 6f 6e 73 74 72 61 69 6e 74 20 74 65 73 74 75 74  onstraint testut
0640: 66 70 72 65 76 20 5b 6c 6c 65 6e 67 74 68 20 5b  fprev [llength [
0650: 69 6e 66 6f 20 63 6f 6d 6d 61 6e 64 73 20 74 65  info commands te
0660: 73 74 75 74 66 70 72 65 76 5d 5d 0a 0a 74 65 73  stutfprev]]..tes
0670: 74 43 6f 6e 73 74 72 61 69 6e 74 20 74 69 70 34  tConstraint tip4
0680: 31 33 20 5b 65 71 20 7b 7d 20 5b 73 74 72 69 6e  13 [eq {} [strin
0690: 67 20 74 72 69 6d 20 5c 78 30 30 5d 5d 0a 0a 63  g trim \x00]]..c
06a0: 61 74 63 68 20 7b 75 6e 73 65 74 20 78 7d 0a 0a  atch {unset x}..
06b0: 74 65 73 74 20 75 74 66 2d 31 2e 31 20 7b 54 63  test utf-1.1 {Tc
06c0: 6c 5f 55 6e 69 43 68 61 72 54 6f 55 74 66 3a 20  l_UniCharToUtf: 
06d0: 31 20 62 79 74 65 20 73 65 71 75 65 6e 63 65 73  1 byte sequences
06e0: 7d 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  } testbytestring
06f0: 20 7b 0a 20 20 20 20 65 78 70 72 20 7b 22 5c 78   {.    expr {"\x
0700: 30 31 22 20 65 71 20 5b 74 65 73 74 62 79 74 65  01" eq [testbyte
0710: 73 74 72 69 6e 67 20 5c 78 30 31 5d 7d 0a 7d 20  string \x01]}.} 
0720: 31 0a 74 65 73 74 20 75 74 66 2d 31 2e 32 20 7b  1.test utf-1.2 {
0730: 54 63 6c 5f 55 6e 69 43 68 61 72 54 6f 55 74 66  Tcl_UniCharToUtf
0740: 3a 20 32 20 62 79 74 65 20 73 65 71 75 65 6e 63  : 2 byte sequenc
0750: 65 73 7d 20 74 65 73 74 62 79 74 65 73 74 72 69  es} testbytestri
0760: 6e 67 20 7b 0a 20 20 20 20 65 78 70 72 20 7b 22  ng {.    expr {"
0770: 5c 78 30 30 22 20 65 71 20 5b 74 65 73 74 62 79  \x00" eq [testby
0780: 74 65 73 74 72 69 6e 67 20 5c 78 43 30 5c 78 38  testring \xC0\x8
0790: 30 5d 7d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66  0]}.} 1.test utf
07a0: 2d 31 2e 33 20 7b 54 63 6c 5f 55 6e 69 43 68 61  -1.3 {Tcl_UniCha
07b0: 72 54 6f 55 74 66 3a 20 32 20 62 79 74 65 20 73  rToUtf: 2 byte s
07c0: 65 71 75 65 6e 63 65 73 7d 20 74 65 73 74 62 79  equences} testby
07d0: 74 65 73 74 72 69 6e 67 20 7b 0a 20 20 20 20 65  testring {.    e
07e0: 78 70 72 20 7b 22 5c 78 45 30 22 20 65 71 20 5b  xpr {"\xE0" eq [
07f0: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c  testbytestring \
0800: 78 43 33 5c 78 41 30 5d 7d 0a 7d 20 31 0a 74 65  xC3\xA0]}.} 1.te
0810: 73 74 20 75 74 66 2d 31 2e 34 20 7b 54 63 6c 5f  st utf-1.4 {Tcl_
0820: 55 6e 69 43 68 61 72 54 6f 55 74 66 3a 20 33 20  UniCharToUtf: 3 
0830: 62 79 74 65 20 73 65 71 75 65 6e 63 65 73 7d 20  byte sequences} 
0840: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 7b  testbytestring {
0850: 0a 20 20 20 20 65 78 70 72 20 7b 22 5c 75 34 45  .    expr {"\u4E
0860: 34 45 22 20 65 71 20 5b 74 65 73 74 62 79 74 65  4E" eq [testbyte
0870: 73 74 72 69 6e 67 20 5c 78 45 34 5c 78 42 39 5c  string \xE4\xB9\
0880: 78 38 45 5d 7d 0a 7d 20 31 0a 74 65 73 74 20 75  x8E]}.} 1.test u
0890: 74 66 2d 31 2e 35 20 7b 54 63 6c 5f 55 6e 69 43  tf-1.5 {Tcl_UniC
08a0: 68 61 72 54 6f 55 74 66 3a 20 6f 76 65 72 66 6c  harToUtf: overfl
08b0: 6f 77 65 64 20 54 63 6c 5f 55 6e 69 43 68 61 72  owed Tcl_UniChar
08c0: 7d 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  } testbytestring
08d0: 20 7b 0a 20 20 20 20 65 78 70 72 20 7b 5b 66 6f   {.    expr {[fo
08e0: 72 6d 61 74 20 25 63 20 30 78 31 31 30 30 30 30  rmat %c 0x110000
08f0: 5d 20 65 71 20 5b 74 65 73 74 62 79 74 65 73 74  ] eq [testbytest
0900: 72 69 6e 67 20 5c 78 45 46 5c 78 42 46 5c 78 42  ring \xEF\xBF\xB
0910: 44 5d 7d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66  D]}.} 1.test utf
0920: 2d 31 2e 36 20 7b 54 63 6c 5f 55 6e 69 43 68 61  -1.6 {Tcl_UniCha
0930: 72 54 6f 55 74 66 3a 20 6e 65 67 61 74 69 76 65  rToUtf: negative
0940: 20 54 63 6c 5f 55 6e 69 43 68 61 72 7d 20 74 65   Tcl_UniChar} te
0950: 73 74 62 79 74 65 73 74 72 69 6e 67 20 7b 0a 20  stbytestring {. 
0960: 20 20 20 65 78 70 72 20 7b 5b 66 6f 72 6d 61 74     expr {[format
0970: 20 25 63 20 2d 31 5d 20 65 71 20 5b 74 65 73 74   %c -1] eq [test
0980: 62 79 74 65 73 74 72 69 6e 67 20 5c 78 45 46 5c  bytestring \xEF\
0990: 78 42 46 5c 78 42 44 5d 7d 0a 7d 20 31 0a 74 65  xBF\xBD]}.} 1.te
09a0: 73 74 20 75 74 66 2d 31 2e 37 2e 30 20 7b 54 63  st utf-1.7.0 {Tc
09b0: 6c 5f 55 6e 69 43 68 61 72 54 6f 55 74 66 3a 20  l_UniCharToUtf: 
09c0: 34 20 62 79 74 65 20 73 65 71 75 65 6e 63 65 73  4 byte sequences
09d0: 7d 20 7b 66 75 6c 6c 75 74 66 20 55 65 73 63 20  } {fullutf Uesc 
09e0: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20  testbytestring} 
09f0: 7b 0a 20 20 20 20 65 78 70 72 20 7b 22 5c 55 30  {.    expr {"\U0
0a00: 31 34 45 34 45 22 20 65 71 20 5b 74 65 73 74 62  14E4E" eq [testb
0a10: 79 74 65 73 74 72 69 6e 67 20 5c 78 46 30 5c 78  ytestring \xF0\x
0a20: 39 34 5c 78 42 39 5c 78 38 45 5d 7d 0a 7d 20 31  94\xB9\x8E]}.} 1
0a30: 0a 74 65 73 74 20 75 74 66 2d 31 2e 37 2e 31 20  .test utf-1.7.1 
0a40: 7b 54 63 6c 5f 55 6e 69 43 68 61 72 54 6f 55 74  {Tcl_UniCharToUt
0a50: 66 3a 20 34 20 62 79 74 65 20 73 65 71 75 65 6e  f: 4 byte sequen
0a60: 63 65 73 7d 20 7b 75 63 73 32 20 55 65 73 63 20  ces} {ucs2 Uesc 
0a70: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20  testbytestring} 
0a80: 7b 0a 20 20 20 20 65 78 70 72 20 7b 22 5c 55 30  {.    expr {"\U0
0a90: 31 34 45 34 45 22 20 65 71 20 5b 74 65 73 74 62  14E4E" eq [testb
0aa0: 79 74 65 73 74 72 69 6e 67 20 5c 78 46 30 5c 78  ytestring \xF0\x
0ab0: 39 34 5c 78 42 39 5c 78 38 45 5d 7d 0a 7d 20 30  94\xB9\x8E]}.} 0
0ac0: 0a 74 65 73 74 20 75 74 66 2d 31 2e 38 20 7b 54  .test utf-1.8 {T
0ad0: 63 6c 5f 55 6e 69 43 68 61 72 54 6f 55 74 66 3a  cl_UniCharToUtf:
0ae0: 20 33 20 62 79 74 65 20 73 65 71 75 65 6e 63 65   3 byte sequence
0af0: 2c 20 68 69 67 68 20 73 75 72 72 6f 67 61 74 65  , high surrogate
0b00: 7d 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  } testbytestring
0b10: 20 7b 0a 20 20 20 20 65 78 70 72 20 7b 22 5c 75   {.    expr {"\u
0b20: 44 38 34 32 22 20 65 71 20 5b 74 65 73 74 62 79  D842" eq [testby
0b30: 74 65 73 74 72 69 6e 67 20 5c 78 45 44 5c 78 41  testring \xED\xA
0b40: 31 5c 78 38 32 5d 7d 0a 7d 20 31 0a 74 65 73 74  1\x82]}.} 1.test
0b50: 20 75 74 66 2d 31 2e 39 20 7b 54 63 6c 5f 55 6e   utf-1.9 {Tcl_Un
0b60: 69 43 68 61 72 54 6f 55 74 66 3a 20 33 20 62 79  iCharToUtf: 3 by
0b70: 74 65 20 73 65 71 75 65 6e 63 65 2c 20 6c 6f 77  te sequence, low
0b80: 20 73 75 72 72 6f 67 61 74 65 7d 20 74 65 73 74   surrogate} test
0b90: 62 79 74 65 73 74 72 69 6e 67 20 7b 0a 20 20 20  bytestring {.   
0ba0: 20 65 78 70 72 20 7b 22 5c 75 44 43 34 32 22 20   expr {"\uDC42" 
0bb0: 65 71 20 5b 74 65 73 74 62 79 74 65 73 74 72 69  eq [testbytestri
0bc0: 6e 67 20 5c 78 45 44 5c 78 42 31 5c 78 38 32 5d  ng \xED\xB1\x82]
0bd0: 7d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 31  }.} 1.test utf-1
0be0: 2e 31 30 20 7b 54 63 6c 5f 55 6e 69 43 68 61 72  .10 {Tcl_UniChar
0bf0: 54 6f 55 74 66 3a 20 33 20 62 79 74 65 20 73 65  ToUtf: 3 byte se
0c00: 71 75 65 6e 63 65 2c 20 68 69 67 68 20 73 75 72  quence, high sur
0c10: 72 6f 67 61 74 65 7d 20 74 65 73 74 62 79 74 65  rogate} testbyte
0c20: 73 74 72 69 6e 67 20 7b 0a 20 20 20 20 65 78 70  string {.    exp
0c30: 72 20 7b 5b 66 6f 72 6d 61 74 20 25 63 20 30 78  r {[format %c 0x
0c40: 44 38 34 32 5d 20 65 71 20 5b 74 65 73 74 62 79  D842] eq [testby
0c50: 74 65 73 74 72 69 6e 67 20 5c 78 45 44 5c 78 41  testring \xED\xA
0c60: 31 5c 78 38 32 5d 7d 0a 7d 20 31 0a 74 65 73 74  1\x82]}.} 1.test
0c70: 20 75 74 66 2d 31 2e 31 31 20 7b 54 63 6c 5f 55   utf-1.11 {Tcl_U
0c80: 6e 69 43 68 61 72 54 6f 55 74 66 3a 20 33 20 62  niCharToUtf: 3 b
0c90: 79 74 65 20 73 65 71 75 65 6e 63 65 2c 20 6c 6f  yte sequence, lo
0ca0: 77 20 73 75 72 72 6f 67 61 74 65 7d 20 74 65 73  w surrogate} tes
0cb0: 74 62 79 74 65 73 74 72 69 6e 67 20 7b 0a 20 20  tbytestring {.  
0cc0: 20 20 65 78 70 72 20 7b 5b 66 6f 72 6d 61 74 20    expr {[format 
0cd0: 25 63 20 30 78 44 43 34 32 5d 20 65 71 20 5b 74  %c 0xDC42] eq [t
0ce0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
0cf0: 45 44 5c 78 42 31 5c 78 38 32 5d 7d 0a 7d 20 31  ED\xB1\x82]}.} 1
0d00: 0a 74 65 73 74 20 75 74 66 2d 31 2e 31 32 20 7b  .test utf-1.12 {
0d10: 54 63 6c 5f 55 6e 69 43 68 61 72 54 6f 55 74 66  Tcl_UniCharToUtf
0d20: 3a 20 34 20 62 79 74 65 20 73 65 71 75 65 6e 63  : 4 byte sequenc
0d30: 65 2c 20 68 69 67 68 2f 6c 6f 77 20 73 75 72 72  e, high/low surr
0d40: 6f 67 61 74 65 7d 20 7b 70 61 69 72 73 54 6f 34  ogate} {pairsTo4
0d50: 62 79 74 65 73 20 74 65 73 74 62 79 74 65 73 74  bytes testbytest
0d60: 72 69 6e 67 7d 20 7b 0a 20 20 20 20 65 78 70 72  ring} {.    expr
0d70: 20 7b 22 5c 75 44 38 34 32 5c 75 44 43 34 32 22   {"\uD842\uDC42"
0d80: 20 65 71 20 5b 74 65 73 74 62 79 74 65 73 74 72   eq [testbytestr
0d90: 69 6e 67 20 5c 78 46 30 5c 78 41 30 5c 78 41 31  ing \xF0\xA0\xA1
0da0: 5c 78 38 32 5d 7d 0a 7d 20 31 0a 74 65 73 74 20  \x82]}.} 1.test 
0db0: 75 74 66 2d 31 2e 31 33 20 7b 54 63 6c 5f 55 6e  utf-1.13 {Tcl_Un
0dc0: 69 43 68 61 72 54 6f 55 74 66 3a 20 49 6e 76 61  iCharToUtf: Inva
0dd0: 6c 69 64 20 73 75 72 72 6f 67 61 74 65 7d 20 7b  lid surrogate} {
0de0: 55 65 73 63 20 74 65 73 74 62 79 74 65 73 74 72  Uesc testbytestr
0df0: 69 6e 67 7d 20 7b 0a 20 20 20 20 65 78 70 72 20  ing} {.    expr 
0e00: 7b 22 5c 55 44 38 34 32 22 20 65 71 20 5b 74 65  {"\UD842" eq [te
0e10: 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 45  stbytestring \xE
0e20: 46 5c 78 42 46 5c 78 42 44 5d 7d 0a 7d 20 31 0a  F\xBF\xBD]}.} 1.
0e30: 0a 74 65 73 74 20 75 74 66 2d 32 2e 31 20 7b 54  .test utf-2.1 {T
0e40: 63 6c 5f 55 74 66 54 6f 55 6e 69 43 68 61 72 3a  cl_UtfToUniChar:
0e50: 20 6c 6f 77 20 61 73 63 69 69 7d 20 7b 0a 20 20   low ascii} {.  
0e60: 20 20 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20    string length 
0e70: 22 61 62 63 22 0a 7d 20 33 0a 74 65 73 74 20 75  "abc".} 3.test u
0e80: 74 66 2d 32 2e 32 20 7b 54 63 6c 5f 55 74 66 54  tf-2.2 {Tcl_UtfT
0e90: 6f 55 6e 69 43 68 61 72 3a 20 6e 61 6b 65 64 20  oUniChar: naked 
0ea0: 74 72 61 69 6c 20 62 79 74 65 73 7d 20 74 65 73  trail bytes} tes
0eb0: 74 62 79 74 65 73 74 72 69 6e 67 20 7b 0a 20 20  tbytestring {.  
0ec0: 20 20 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20    string length 
0ed0: 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20  [testbytestring 
0ee0: 5c 78 38 32 5c 78 38 33 5c 78 38 34 5d 0a 7d 20  \x82\x83\x84].} 
0ef0: 33 0a 74 65 73 74 20 75 74 66 2d 32 2e 33 20 7b  3.test utf-2.3 {
0f00: 54 63 6c 5f 55 74 66 54 6f 55 6e 69 43 68 61 72  Tcl_UtfToUniChar
0f10: 3a 20 6c 65 61 64 20 28 32 2d 62 79 74 65 29 20  : lead (2-byte) 
0f20: 66 6f 6c 6c 6f 77 65 64 20 62 79 20 6e 6f 6e 2d  followed by non-
0f30: 74 72 61 69 6c 7d 20 74 65 73 74 62 79 74 65 73  trail} testbytes
0f40: 74 72 69 6e 67 20 7b 0a 20 20 20 20 73 74 72 69  tring {.    stri
0f50: 6e 67 20 6c 65 6e 67 74 68 20 5b 74 65 73 74 62  ng length [testb
0f60: 79 74 65 73 74 72 69 6e 67 20 5c 78 43 32 5d 0a  ytestring \xC2].
0f70: 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 32 2e 34  } 1.test utf-2.4
0f80: 20 7b 54 63 6c 5f 55 74 66 54 6f 55 6e 69 43 68   {Tcl_UtfToUniCh
0f90: 61 72 3a 20 6c 65 61 64 20 28 32 2d 62 79 74 65  ar: lead (2-byte
0fa0: 29 20 66 6f 6c 6c 6f 77 65 64 20 62 79 20 74 72  ) followed by tr
0fb0: 61 69 6c 7d 20 74 65 73 74 62 79 74 65 73 74 72  ail} testbytestr
0fc0: 69 6e 67 20 7b 0a 20 20 20 20 73 74 72 69 6e 67  ing {.    string
0fd0: 20 6c 65 6e 67 74 68 20 5b 74 65 73 74 62 79 74   length [testbyt
0fe0: 65 73 74 72 69 6e 67 20 5c 78 43 32 5c 78 41 32  estring \xC2\xA2
0ff0: 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 32  ].} 1.test utf-2
1000: 2e 35 20 7b 54 63 6c 5f 55 74 66 54 6f 55 6e 69  .5 {Tcl_UtfToUni
1010: 43 68 61 72 3a 20 6c 65 61 64 20 28 33 2d 62 79  Char: lead (3-by
1020: 74 65 29 20 66 6f 6c 6c 6f 77 65 64 20 62 79 20  te) followed by 
1030: 6e 6f 6e 2d 74 72 61 69 6c 7d 20 74 65 73 74 62  non-trail} testb
1040: 79 74 65 73 74 72 69 6e 67 20 7b 0a 20 20 20 20  ytestring {.    
1050: 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 5b 74  string length [t
1060: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
1070: 45 32 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66  E2].} 1.test utf
1080: 2d 32 2e 36 20 7b 54 63 6c 5f 55 74 66 54 6f 55  -2.6 {Tcl_UtfToU
1090: 6e 69 43 68 61 72 3a 20 6c 65 61 64 20 28 33 2d  niChar: lead (3-
10a0: 62 79 74 65 29 20 66 6f 6c 6c 6f 77 65 64 20 62  byte) followed b
10b0: 79 20 31 20 74 72 61 69 6c 7d 20 74 65 73 74 62  y 1 trail} testb
10c0: 79 74 65 73 74 72 69 6e 67 20 7b 0a 20 20 20 20  ytestring {.    
10d0: 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 5b 74  string length [t
10e0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
10f0: 45 32 5c 78 41 32 5d 0a 7d 20 32 0a 74 65 73 74  E2\xA2].} 2.test
1100: 20 75 74 66 2d 32 2e 37 20 7b 54 63 6c 5f 55 74   utf-2.7 {Tcl_Ut
1110: 66 54 6f 55 6e 69 43 68 61 72 3a 20 6c 65 61 64  fToUniChar: lead
1120: 20 28 33 2d 62 79 74 65 29 20 66 6f 6c 6c 6f 77   (3-byte) follow
1130: 65 64 20 62 79 20 32 20 74 72 61 69 6c 7d 20 74  ed by 2 trail} t
1140: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 7b 0a  estbytestring {.
1150: 20 20 20 20 73 74 72 69 6e 67 20 6c 65 6e 67 74      string lengt
1160: 68 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e  h [testbytestrin
1170: 67 20 5c 78 45 34 5c 78 42 39 5c 78 38 45 5d 0a  g \xE4\xB9\x8E].
1180: 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 32 2e 38  } 1.test utf-2.8
1190: 2e 30 20 7b 54 63 6c 5f 55 74 66 54 6f 55 6e 69  .0 {Tcl_UtfToUni
11a0: 43 68 61 72 3a 20 6c 65 61 64 20 28 34 2d 62 79  Char: lead (4-by
11b0: 74 65 29 20 66 6f 6c 6c 6f 77 65 64 20 62 79 20  te) followed by 
11c0: 33 20 74 72 61 69 6c 7d 20 7b 74 65 73 74 62 79  3 trail} {testby
11d0: 74 65 73 74 72 69 6e 67 20 75 63 73 32 7d 20 7b  testring ucs2} {
11e0: 0a 20 20 20 20 73 74 72 69 6e 67 20 6c 65 6e 67  .    string leng
11f0: 74 68 20 5b 74 65 73 74 62 79 74 65 73 74 72 69  th [testbytestri
1200: 6e 67 20 5c 78 46 30 5c 78 39 30 5c 78 38 30 5c  ng \xF0\x90\x80\
1210: 78 38 30 5d 0a 7d 20 34 0a 74 65 73 74 20 75 74  x80].} 4.test ut
1220: 66 2d 32 2e 38 2e 31 20 7b 54 63 6c 5f 55 74 66  f-2.8.1 {Tcl_Utf
1230: 54 6f 55 6e 69 43 68 61 72 3a 20 6c 65 61 64 20  ToUniChar: lead 
1240: 28 34 2d 62 79 74 65 29 20 66 6f 6c 6c 6f 77 65  (4-byte) followe
1250: 64 20 62 79 20 33 20 74 72 61 69 6c 7d 20 7b 74  d by 3 trail} {t
1260: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 75 63  estbytestring uc
1270: 73 34 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e 67  s4} {.    string
1280: 20 6c 65 6e 67 74 68 20 5b 74 65 73 74 62 79 74   length [testbyt
1290: 65 73 74 72 69 6e 67 20 5c 78 46 30 5c 78 39 30  estring \xF0\x90
12a0: 5c 78 38 30 5c 78 38 30 5d 0a 7d 20 31 0a 74 65  \x80\x80].} 1.te
12b0: 73 74 20 75 74 66 2d 32 2e 38 2e 32 20 7b 54 63  st utf-2.8.2 {Tc
12c0: 6c 5f 55 74 66 54 6f 55 6e 69 43 68 61 72 3a 20  l_UtfToUniChar: 
12d0: 6c 65 61 64 20 28 34 2d 62 79 74 65 29 20 66 6f  lead (4-byte) fo
12e0: 6c 6c 6f 77 65 64 20 62 79 20 33 20 74 72 61 69  llowed by 3 trai
12f0: 6c 7d 20 7b 74 65 73 74 62 79 74 65 73 74 72 69  l} {testbytestri
1300: 6e 67 20 74 69 70 33 38 39 7d 20 7b 0a 20 20 20  ng tip389} {.   
1310: 20 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 5b   string length [
1320: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c  testbytestring \
1330: 78 46 30 5c 78 39 30 5c 78 38 30 5c 78 38 30 5d  xF0\x90\x80\x80]
1340: 0a 7d 20 32 0a 74 65 73 74 20 75 74 66 2d 32 2e  .} 2.test utf-2.
1350: 39 2e 30 20 7b 54 63 6c 5f 55 74 66 54 6f 55 6e  9.0 {Tcl_UtfToUn
1360: 69 43 68 61 72 3a 20 6c 65 61 64 20 28 34 2d 62  iChar: lead (4-b
1370: 79 74 65 29 20 66 6f 6c 6c 6f 77 65 64 20 62 79  yte) followed by
1380: 20 33 20 74 72 61 69 6c 7d 20 7b 74 65 73 74 62   3 trail} {testb
1390: 79 74 65 73 74 72 69 6e 67 20 75 63 73 32 7d 20  ytestring ucs2} 
13a0: 7b 0a 20 20 20 20 73 74 72 69 6e 67 20 6c 65 6e  {.    string len
13b0: 67 74 68 20 5b 74 65 73 74 62 79 74 65 73 74 72  gth [testbytestr
13c0: 69 6e 67 20 5c 78 46 34 5c 78 38 46 5c 78 42 46  ing \xF4\x8F\xBF
13d0: 5c 78 42 46 5d 0a 7d 20 34 0a 74 65 73 74 20 75  \xBF].} 4.test u
13e0: 74 66 2d 32 2e 39 2e 31 20 7b 54 63 6c 5f 55 74  tf-2.9.1 {Tcl_Ut
13f0: 66 54 6f 55 6e 69 43 68 61 72 3a 20 6c 65 61 64  fToUniChar: lead
1400: 20 28 34 2d 62 79 74 65 29 20 66 6f 6c 6c 6f 77   (4-byte) follow
1410: 65 64 20 62 79 20 33 20 74 72 61 69 6c 7d 20 75  ed by 3 trail} u
1420: 63 73 34 20 7b 0a 20 20 20 20 73 74 72 69 6e 67  cs4 {.    string
1430: 20 6c 65 6e 67 74 68 20 5c 55 31 30 46 46 46 46   length \U10FFFF
1440: 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 32 2e  .} 1.test utf-2.
1450: 39 2e 32 20 7b 54 63 6c 5f 55 74 66 54 6f 55 6e  9.2 {Tcl_UtfToUn
1460: 69 43 68 61 72 3a 20 6c 65 61 64 20 28 34 2d 62  iChar: lead (4-b
1470: 79 74 65 29 20 66 6f 6c 6c 6f 77 65 64 20 62 79  yte) followed by
1480: 20 33 20 74 72 61 69 6c 7d 20 21 75 63 73 34 20   3 trail} !ucs4 
1490: 7b 0a 20 20 20 20 73 74 72 69 6e 67 20 6c 65 6e  {.    string len
14a0: 67 74 68 20 5c 75 44 42 46 46 5c 75 44 46 46 46  gth \uDBFF\uDFFF
14b0: 0a 7d 20 32 0a 74 65 73 74 20 75 74 66 2d 32 2e  .} 2.test utf-2.
14c0: 31 30 20 7b 54 63 6c 5f 55 74 66 54 6f 55 6e 69  10 {Tcl_UtfToUni
14d0: 43 68 61 72 3a 20 6c 65 61 64 20 28 34 2d 62 79  Char: lead (4-by
14e0: 74 65 29 20 66 6f 6c 6c 6f 77 65 64 20 62 79 20  te) followed by 
14f0: 33 20 74 72 61 69 6c 2c 20 75 6e 64 65 72 66 6c  3 trail, underfl
1500: 6f 77 7d 20 74 65 73 74 62 79 74 65 73 74 72 69  ow} testbytestri
1510: 6e 67 20 7b 0a 20 20 20 20 73 74 72 69 6e 67 20  ng {.    string 
1520: 6c 65 6e 67 74 68 20 5b 74 65 73 74 62 79 74 65  length [testbyte
1530: 73 74 72 69 6e 67 20 5c 78 46 30 5c 78 38 46 5c  string \xF0\x8F\
1540: 78 42 46 5c 78 42 46 5d 0a 7d 20 34 0a 74 65 73  xBF\xBF].} 4.tes
1550: 74 20 75 74 66 2d 32 2e 31 31 20 7b 54 63 6c 5f  t utf-2.11 {Tcl_
1560: 55 74 66 54 6f 55 6e 69 43 68 61 72 3a 20 6c 65  UtfToUniChar: le
1570: 61 64 20 28 34 2d 62 79 74 65 29 20 66 6f 6c 6c  ad (4-byte) foll
1580: 6f 77 65 64 20 62 79 20 33 20 74 72 61 69 6c 2c  owed by 3 trail,
1590: 20 6f 76 65 72 66 6c 6f 77 7d 20 74 65 73 74 62   overflow} testb
15a0: 79 74 65 73 74 72 69 6e 67 20 7b 0a 20 20 20 20  ytestring {.    
15b0: 23 20 57 6f 75 6c 64 20 64 65 63 6f 64 65 20 74  # Would decode t
15c0: 6f 20 55 2b 31 31 30 30 30 30 20 62 75 74 20 74  o U+110000 but t
15d0: 68 61 74 20 69 73 20 6f 75 74 73 69 64 65 20 74  hat is outside t
15e0: 68 65 20 55 6e 69 63 6f 64 65 20 72 61 6e 67 65  he Unicode range
15f0: 2e 0a 20 20 20 20 73 74 72 69 6e 67 20 6c 65 6e  ..    string len
1600: 67 74 68 20 5b 74 65 73 74 62 79 74 65 73 74 72  gth [testbytestr
1610: 69 6e 67 20 5c 78 46 34 5c 78 39 30 5c 78 38 30  ing \xF4\x90\x80
1620: 5c 78 38 30 5d 0a 7d 20 34 0a 74 65 73 74 20 75  \x80].} 4.test u
1630: 74 66 2d 32 2e 31 32 20 7b 54 63 6c 5f 55 74 66  tf-2.12 {Tcl_Utf
1640: 54 6f 55 6e 69 43 68 61 72 3a 20 6c 6f 6e 67 65  ToUniChar: longe
1650: 72 20 55 54 46 20 73 65 71 75 65 6e 63 65 73 20  r UTF sequences 
1660: 6e 6f 74 20 73 75 70 70 6f 72 74 65 64 7d 20 74  not supported} t
1670: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 7b 0a  estbytestring {.
1680: 20 20 20 20 73 74 72 69 6e 67 20 6c 65 6e 67 74      string lengt
1690: 68 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e  h [testbytestrin
16a0: 67 20 5c 78 46 38 5c 78 41 32 5c 78 41 32 5c 78  g \xF8\xA2\xA2\x
16b0: 41 32 5c 78 41 32 5d 0a 7d 20 35 0a 0a 74 65 73  A2\xA2].} 5..tes
16c0: 74 20 75 74 66 2d 33 2e 31 20 7b 54 63 6c 5f 55  t utf-3.1 {Tcl_U
16d0: 74 66 43 68 61 72 43 6f 6d 70 6c 65 74 65 7d 20  tfCharComplete} 
16e0: 7b 0a 7d 20 7b 7d 0a 0a 74 65 73 74 20 75 74 66  {.} {}..test utf
16f0: 2d 34 2e 31 20 7b 54 63 6c 5f 4e 75 6d 55 74 66  -4.1 {Tcl_NumUtf
1700: 43 68 61 72 73 3a 20 7a 65 72 6f 20 6c 65 6e 67  Chars: zero leng
1710: 74 68 7d 20 74 65 73 74 6e 75 6d 75 74 66 63 68  th} testnumutfch
1720: 61 72 73 20 7b 0a 20 20 20 20 74 65 73 74 6e 75  ars {.    testnu
1730: 6d 75 74 66 63 68 61 72 73 20 22 22 0a 7d 20 30  mutfchars "".} 0
1740: 0a 74 65 73 74 20 75 74 66 2d 34 2e 32 20 7b 54  .test utf-4.2 {T
1750: 63 6c 5f 4e 75 6d 55 74 66 43 68 61 72 73 3a 20  cl_NumUtfChars: 
1760: 6c 65 6e 67 74 68 20 31 7d 20 7b 74 65 73 74 6e  length 1} {testn
1770: 75 6d 75 74 66 63 68 61 72 73 20 74 65 73 74 62  umutfchars testb
1780: 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20  ytestring} {.   
1790: 20 74 65 73 74 6e 75 6d 75 74 66 63 68 61 72 73   testnumutfchars
17a0: 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67   [testbytestring
17b0: 20 5c 78 43 32 5c 78 41 32 5d 0a 7d 20 31 0a 74   \xC2\xA2].} 1.t
17c0: 65 73 74 20 75 74 66 2d 34 2e 33 20 7b 54 63 6c  est utf-4.3 {Tcl
17d0: 5f 4e 75 6d 55 74 66 43 68 61 72 73 3a 20 6c 6f  _NumUtfChars: lo
17e0: 6e 67 20 73 74 72 69 6e 67 7d 20 7b 74 65 73 74  ng string} {test
17f0: 6e 75 6d 75 74 66 63 68 61 72 73 20 74 65 73 74  numutfchars test
1800: 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20  bytestring} {.  
1810: 20 20 74 65 73 74 6e 75 6d 75 74 66 63 68 61 72    testnumutfchar
1820: 73 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e  s [testbytestrin
1830: 67 20 61 62 63 5c 78 43 32 5c 78 41 32 5c 78 45  g abc\xC2\xA2\xE
1840: 34 5c 78 42 39 5c 78 38 45 5c 78 41 32 5c 78 34  4\xB9\x8E\xA2\x4
1850: 45 5d 0a 7d 20 37 0a 74 65 73 74 20 75 74 66 2d  E].} 7.test utf-
1860: 34 2e 34 20 7b 54 63 6c 5f 4e 75 6d 55 74 66 43  4.4 {Tcl_NumUtfC
1870: 68 61 72 73 3a 20 23 75 30 30 30 30 7d 20 7b 74  hars: #u0000} {t
1880: 65 73 74 6e 75 6d 75 74 66 63 68 61 72 73 20 74  estnumutfchars t
1890: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
18a0: 0a 20 20 20 20 74 65 73 74 6e 75 6d 75 74 66 63  .    testnumutfc
18b0: 68 61 72 73 20 5b 74 65 73 74 62 79 74 65 73 74  hars [testbytest
18c0: 72 69 6e 67 20 5c 78 43 30 5c 78 38 30 5d 0a 7d  ring \xC0\x80].}
18d0: 20 31 0a 74 65 73 74 20 75 74 66 2d 34 2e 35 20   1.test utf-4.5 
18e0: 7b 54 63 6c 5f 4e 75 6d 55 74 66 43 68 61 72 73  {Tcl_NumUtfChars
18f0: 3a 20 7a 65 72 6f 20 6c 65 6e 67 74 68 2c 20 63  : zero length, c
1900: 61 6c 63 20 6c 65 6e 7d 20 74 65 73 74 6e 75 6d  alc len} testnum
1910: 75 74 66 63 68 61 72 73 20 7b 0a 20 20 20 20 74  utfchars {.    t
1920: 65 73 74 6e 75 6d 75 74 66 63 68 61 72 73 20 22  estnumutfchars "
1930: 22 20 30 0a 7d 20 30 0a 74 65 73 74 20 75 74 66  " 0.} 0.test utf
1940: 2d 34 2e 36 20 7b 54 63 6c 5f 4e 75 6d 55 74 66  -4.6 {Tcl_NumUtf
1950: 43 68 61 72 73 3a 20 6c 65 6e 67 74 68 20 31 2c  Chars: length 1,
1960: 20 63 61 6c 63 20 6c 65 6e 7d 20 7b 74 65 73 74   calc len} {test
1970: 6e 75 6d 75 74 66 63 68 61 72 73 20 74 65 73 74  numutfchars test
1980: 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20  bytestring} {.  
1990: 20 20 74 65 73 74 6e 75 6d 75 74 66 63 68 61 72    testnumutfchar
19a0: 73 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e  s [testbytestrin
19b0: 67 20 5c 78 43 32 5c 78 41 32 5d 20 65 6e 64 0a  g \xC2\xA2] end.
19c0: 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 34 2e 37  } 1.test utf-4.7
19d0: 20 7b 54 63 6c 5f 4e 75 6d 55 74 66 43 68 61 72   {Tcl_NumUtfChar
19e0: 73 3a 20 6c 6f 6e 67 20 73 74 72 69 6e 67 2c 20  s: long string, 
19f0: 63 61 6c 63 20 6c 65 6e 7d 20 7b 74 65 73 74 6e  calc len} {testn
1a00: 75 6d 75 74 66 63 68 61 72 73 20 74 65 73 74 62  umutfchars testb
1a10: 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20  ytestring} {.   
1a20: 20 74 65 73 74 6e 75 6d 75 74 66 63 68 61 72 73   testnumutfchars
1a30: 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67   [testbytestring
1a40: 20 61 62 63 5c 78 43 32 5c 78 41 32 5c 78 45 34   abc\xC2\xA2\xE4
1a50: 5c 78 42 39 5c 78 38 45 5c 78 41 32 5c 78 34 45  \xB9\x8E\xA2\x4E
1a60: 5d 20 65 6e 64 0a 7d 20 37 0a 74 65 73 74 20 75  ] end.} 7.test u
1a70: 74 66 2d 34 2e 38 20 7b 54 63 6c 5f 4e 75 6d 55  tf-4.8 {Tcl_NumU
1a80: 74 66 43 68 61 72 73 3a 20 23 75 30 30 30 30 2c  tfChars: #u0000,
1a90: 20 63 61 6c 63 20 6c 65 6e 7d 20 7b 74 65 73 74   calc len} {test
1aa0: 6e 75 6d 75 74 66 63 68 61 72 73 20 74 65 73 74  numutfchars test
1ab0: 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20  bytestring} {.  
1ac0: 20 20 74 65 73 74 6e 75 6d 75 74 66 63 68 61 72    testnumutfchar
1ad0: 73 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e  s [testbytestrin
1ae0: 67 20 5c 78 43 30 5c 78 38 30 5d 20 65 6e 64 0a  g \xC0\x80] end.
1af0: 7d 20 31 0a 23 20 42 75 67 20 5b 32 37 33 38 34  } 1.# Bug [27384
1b00: 32 37 5d 3a 20 54 63 6c 5f 4e 75 6d 55 74 66 43  27]: Tcl_NumUtfC
1b10: 68 61 72 73 28 2e 2e 2e 29 20 6e 6f 20 6f 76 65  hars(...) no ove
1b20: 72 66 6c 6f 77 20 63 68 65 63 6b 0a 74 65 73 74  rflow check.test
1b30: 20 75 74 66 2d 34 2e 39 20 7b 54 63 6c 5f 4e 75   utf-4.9 {Tcl_Nu
1b40: 6d 55 74 66 43 68 61 72 73 3a 20 23 75 32 30 41  mUtfChars: #u20A
1b50: 43 2c 20 63 61 6c 63 20 6c 65 6e 2c 20 69 6e 63  C, calc len, inc
1b60: 6f 6d 70 6c 65 74 65 7d 20 7b 74 65 73 74 6e 75  omplete} {testnu
1b70: 6d 75 74 66 63 68 61 72 73 20 74 65 73 74 62 79  mutfchars testby
1b80: 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20  testring} {.    
1b90: 74 65 73 74 6e 75 6d 75 74 66 63 68 61 72 73 20  testnumutfchars 
1ba0: 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20  [testbytestring 
1bb0: 5c 78 45 32 5c 78 38 32 5c 78 41 43 5d 20 65 6e  \xE2\x82\xAC] en
1bc0: 64 2d 31 0a 7d 20 32 0a 74 65 73 74 20 75 74 66  d-1.} 2.test utf
1bd0: 2d 34 2e 31 30 20 7b 54 63 6c 5f 4e 75 6d 55 74  -4.10 {Tcl_NumUt
1be0: 66 43 68 61 72 73 3a 20 23 75 30 30 30 30 2c 20  fChars: #u0000, 
1bf0: 63 61 6c 63 20 6c 65 6e 2c 20 6f 76 65 72 63 6f  calc len, overco
1c00: 6d 70 6c 65 74 65 7d 20 7b 74 65 73 74 6e 75 6d  mplete} {testnum
1c10: 75 74 66 63 68 61 72 73 20 74 65 73 74 62 79 74  utfchars testbyt
1c20: 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74  estring} {.    t
1c30: 65 73 74 6e 75 6d 75 74 66 63 68 61 72 73 20 5b  estnumutfchars [
1c40: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c  testbytestring \
1c50: 78 30 30 5d 20 65 6e 64 2b 31 0a 7d 20 32 0a 74  x00] end+1.} 2.t
1c60: 65 73 74 20 75 74 66 2d 34 2e 31 31 20 7b 54 63  est utf-4.11 {Tc
1c70: 6c 5f 4e 75 6d 55 74 66 43 68 61 72 73 3a 20 33  l_NumUtfChars: 3
1c80: 20 62 79 74 65 73 20 6f 66 20 34 2d 62 79 74 65   bytes of 4-byte
1c90: 20 55 54 46 2d 38 20 63 68 61 72 61 63 61 74 65   UTF-8 characate
1ca0: 72 7d 20 7b 74 65 73 74 6e 75 6d 75 74 66 63 68  r} {testnumutfch
1cb0: 61 72 73 20 74 65 73 74 62 79 74 65 73 74 72 69  ars testbytestri
1cc0: 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 6e 75  ng} {.    testnu
1cd0: 6d 75 74 66 63 68 61 72 73 20 5b 74 65 73 74 62  mutfchars [testb
1ce0: 79 74 65 73 74 72 69 6e 67 20 5c 78 46 30 5c 78  ytestring \xF0\x
1cf0: 39 46 5c 78 39 32 5c 78 41 39 5d 20 65 6e 64 2d  9F\x92\xA9] end-
1d00: 31 0a 7d 20 33 0a 74 65 73 74 20 75 74 66 2d 34  1.} 3.test utf-4
1d10: 2e 31 32 2e 30 20 7b 54 63 6c 5f 4e 75 6d 55 74  .12.0 {Tcl_NumUt
1d20: 66 43 68 61 72 73 3a 20 23 34 2d 62 79 74 65 20  fChars: #4-byte 
1d30: 55 54 46 2d 38 20 63 68 61 72 61 63 74 65 72 7d  UTF-8 character}
1d40: 20 7b 74 65 73 74 6e 75 6d 75 74 66 63 68 61 72   {testnumutfchar
1d50: 73 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  s testbytestring
1d60: 20 75 63 73 32 7d 20 7b 0a 20 20 20 20 74 65 73   ucs2} {.    tes
1d70: 74 6e 75 6d 75 74 66 63 68 61 72 73 20 5b 74 65  tnumutfchars [te
1d80: 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46  stbytestring \xF
1d90: 30 5c 78 39 46 5c 78 39 32 5c 78 41 39 5d 20 65  0\x9F\x92\xA9] e
1da0: 6e 64 0a 7d 20 34 0a 74 65 73 74 20 75 74 66 2d  nd.} 4.test utf-
1db0: 34 2e 31 32 2e 31 20 7b 54 63 6c 5f 4e 75 6d 55  4.12.1 {Tcl_NumU
1dc0: 74 66 43 68 61 72 73 3a 20 23 34 2d 62 79 74 65  tfChars: #4-byte
1dd0: 20 55 54 46 2d 38 20 63 68 61 72 61 63 74 65 72   UTF-8 character
1de0: 7d 20 7b 74 65 73 74 6e 75 6d 75 74 66 63 68 61  } {testnumutfcha
1df0: 72 73 20 74 65 73 74 62 79 74 65 73 74 72 69 6e  rs testbytestrin
1e00: 67 20 75 63 73 34 7d 20 7b 0a 20 20 20 20 74 65  g ucs4} {.    te
1e10: 73 74 6e 75 6d 75 74 66 63 68 61 72 73 20 5b 74  stnumutfchars [t
1e20: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
1e30: 46 30 5c 78 39 46 5c 78 39 32 5c 78 41 39 5d 20  F0\x9F\x92\xA9] 
1e40: 65 6e 64 0a 7d 20 31 0a 74 65 73 74 20 75 74 66  end.} 1.test utf
1e50: 2d 34 2e 31 32 2e 32 20 7b 54 63 6c 5f 4e 75 6d  -4.12.2 {Tcl_Num
1e60: 55 74 66 43 68 61 72 73 3a 20 23 34 2d 62 79 74  UtfChars: #4-byt
1e70: 65 20 55 54 46 2d 38 20 63 68 61 72 61 63 74 65  e UTF-8 characte
1e80: 72 7d 20 7b 74 65 73 74 6e 75 6d 75 74 66 63 68  r} {testnumutfch
1e90: 61 72 73 20 74 65 73 74 62 79 74 65 73 74 72 69  ars testbytestri
1ea0: 6e 67 20 74 69 70 33 38 39 7d 20 7b 0a 20 20 20  ng tip389} {.   
1eb0: 20 74 65 73 74 6e 75 6d 75 74 66 63 68 61 72 73   testnumutfchars
1ec0: 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67   [testbytestring
1ed0: 20 5c 78 46 30 5c 78 39 46 5c 78 39 32 5c 78 41   \xF0\x9F\x92\xA
1ee0: 39 5d 20 65 6e 64 0a 7d 20 32 0a 0a 74 65 73 74  9] end.} 2..test
1ef0: 20 75 74 66 2d 35 2e 31 20 7b 54 63 6c 5f 55 74   utf-5.1 {Tcl_Ut
1f00: 66 46 69 6e 64 46 69 72 73 74 7d 20 7b 74 65 73  fFindFirst} {tes
1f10: 74 66 69 6e 64 66 69 72 73 74 20 74 65 73 74 62  tfindfirst testb
1f20: 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20  ytestring} {.   
1f30: 20 74 65 73 74 66 69 6e 64 66 69 72 73 74 20 5b   testfindfirst [
1f40: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 61  testbytestring a
1f50: 62 63 62 63 5d 20 39 38 0a 7d 20 62 63 62 63 0a  bcbc] 98.} bcbc.
1f60: 74 65 73 74 20 75 74 66 2d 35 2e 32 20 7b 54 63  test utf-5.2 {Tc
1f70: 6c 5f 55 74 66 46 69 6e 64 4c 61 73 74 7d 20 7b  l_UtfFindLast} {
1f80: 74 65 73 74 66 69 6e 64 6c 61 73 74 20 74 65 73  testfindlast tes
1f90: 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20  tbytestring} {. 
1fa0: 20 20 20 74 65 73 74 66 69 6e 64 6c 61 73 74 20     testfindlast 
1fb0: 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20  [testbytestring 
1fc0: 61 62 63 62 63 5d 20 39 38 0a 7d 20 62 63 0a 0a  abcbc] 98.} bc..
1fd0: 74 65 73 74 20 75 74 66 2d 36 2e 31 20 7b 54 63  test utf-6.1 {Tc
1fe0: 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65 73 74  l_UtfNext} {test
1ff0: 75 74 66 6e 65 78 74 20 74 65 73 74 62 79 74 65  utfnext testbyte
2000: 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 23 20  string} {.    # 
2010: 54 68 69 73 20 74 61 6b 65 73 20 74 68 65 20 70  This takes the p
2020: 6f 69 6e 74 65 72 20 6f 6e 65 20 70 61 73 74 20  ointer one past 
2030: 74 68 65 20 74 65 72 6d 69 6e 61 74 69 6e 67 20  the terminating 
2040: 4e 55 4c 2e 0a 20 20 20 20 23 20 54 68 69 73 20  NUL..    # This 
2050: 69 73 20 72 65 61 6c 6c 79 20 61 6e 20 69 6e 76  is really an inv
2060: 61 6c 69 64 20 63 61 6c 6c 2e 0a 20 20 20 20 74  alid call..    t
2070: 65 73 74 75 74 66 6e 65 78 74 20 5b 74 65 73 74  estutfnext [test
2080: 62 79 74 65 73 74 72 69 6e 67 20 7b 7d 5d 0a 7d  bytestring {}].}
2090: 20 31 0a 74 65 73 74 20 75 74 66 2d 36 2e 32 20   1.test utf-6.2 
20a0: 7b 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20 74 65  {Tcl_UtfNext} te
20b0: 73 74 75 74 66 6e 65 78 74 20 7b 0a 20 20 20 20  stutfnext {.    
20c0: 74 65 73 74 75 74 66 6e 65 78 74 20 41 0a 7d 20  testutfnext A.} 
20d0: 31 0a 74 65 73 74 20 75 74 66 2d 36 2e 33 20 7b  1.test utf-6.3 {
20e0: 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20 74 65 73  Tcl_UtfNext} tes
20f0: 74 75 74 66 6e 65 78 74 20 7b 0a 20 20 20 20 74  tutfnext {.    t
2100: 65 73 74 75 74 66 6e 65 78 74 20 41 41 0a 7d 20  estutfnext AA.} 
2110: 31 0a 74 65 73 74 20 75 74 66 2d 36 2e 34 20 7b  1.test utf-6.4 {
2120: 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65  Tcl_UtfNext} {te
2130: 73 74 75 74 66 6e 65 78 74 20 74 65 73 74 62 79  stutfnext testby
2140: 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20  testring} {.    
2150: 74 65 73 74 75 74 66 6e 65 78 74 20 41 5b 74 65  testutfnext A[te
2160: 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 41  stbytestring \xA
2170: 30 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d  0].} 1.test utf-
2180: 36 2e 35 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74  6.5 {Tcl_UtfNext
2190: 7d 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20 74  } {testutfnext t
21a0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
21b0: 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65 78 74  .    testutfnext
21c0: 20 41 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e   A[testbytestrin
21d0: 67 20 5c 78 44 30 5d 0a 7d 20 31 0a 74 65 73 74  g \xD0].} 1.test
21e0: 20 75 74 66 2d 36 2e 36 20 7b 54 63 6c 5f 55 74   utf-6.6 {Tcl_Ut
21f0: 66 4e 65 78 74 7d 20 7b 74 65 73 74 75 74 66 6e  fNext} {testutfn
2200: 65 78 74 20 74 65 73 74 62 79 74 65 73 74 72 69  ext testbytestri
2210: 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74  ng} {.    testut
2220: 66 6e 65 78 74 20 41 5b 74 65 73 74 62 79 74 65  fnext A[testbyte
2230: 73 74 72 69 6e 67 20 5c 78 45 38 5d 0a 7d 20 31  string \xE8].} 1
2240: 0a 74 65 73 74 20 75 74 66 2d 36 2e 37 20 7b 54  .test utf-6.7 {T
2250: 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65 73  cl_UtfNext} {tes
2260: 74 75 74 66 6e 65 78 74 20 74 65 73 74 62 79 74  tutfnext testbyt
2270: 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74  estring} {.    t
2280: 65 73 74 75 74 66 6e 65 78 74 20 41 5b 74 65 73  estutfnext A[tes
2290: 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46 32  tbytestring \xF2
22a0: 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 36  ].} 1.test utf-6
22b0: 2e 38 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74 7d  .8 {Tcl_UtfNext}
22c0: 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20 74 65   {testutfnext te
22d0: 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a  stbytestring} {.
22e0: 20 20 20 20 74 65 73 74 75 74 66 6e 65 78 74 20      testutfnext 
22f0: 41 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  A[testbytestring
2300: 20 5c 78 46 38 5d 0a 7d 20 31 0a 74 65 73 74 20   \xF8].} 1.test 
2310: 75 74 66 2d 36 2e 39 20 7b 54 63 6c 5f 55 74 66  utf-6.9 {Tcl_Utf
2320: 4e 65 78 74 7d 20 7b 74 65 73 74 75 74 66 6e 65  Next} {testutfne
2330: 78 74 20 74 65 73 74 62 79 74 65 73 74 72 69 6e  xt testbytestrin
2340: 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66  g} {.    testutf
2350: 6e 65 78 74 20 5b 74 65 73 74 62 79 74 65 73 74  next [testbytest
2360: 72 69 6e 67 20 5c 78 41 30 5c 78 30 30 5d 0a 7d  ring \xA0\x00].}
2370: 20 31 0a 74 65 73 74 20 75 74 66 2d 36 2e 31 30   1.test utf-6.10
2380: 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b   {Tcl_UtfNext} {
2390: 74 65 73 74 75 74 66 6e 65 78 74 20 74 65 73 74  testutfnext test
23a0: 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20  bytestring} {.  
23b0: 20 20 74 65 73 74 75 74 66 6e 65 78 74 20 5b 74    testutfnext [t
23c0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
23d0: 41 30 5d 47 0a 7d 20 31 0a 74 65 73 74 20 75 74  A0]G.} 1.test ut
23e0: 66 2d 36 2e 31 31 20 7b 54 63 6c 5f 55 74 66 4e  f-6.11 {Tcl_UtfN
23f0: 65 78 74 7d 20 7b 74 65 73 74 75 74 66 6e 65 78  ext} {testutfnex
2400: 74 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  t testbytestring
2410: 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e  } {.    testutfn
2420: 65 78 74 20 5b 74 65 73 74 62 79 74 65 73 74 72  ext [testbytestr
2430: 69 6e 67 20 5c 78 41 30 5c 78 41 30 5c 78 30 30  ing \xA0\xA0\x00
2440: 5d 0a 7d 20 32 0a 74 65 73 74 20 75 74 66 2d 36  ].} 2.test utf-6
2450: 2e 31 32 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74  .12 {Tcl_UtfNext
2460: 7d 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20 74  } {testutfnext t
2470: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
2480: 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65 78 74  .    testutfnext
2490: 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67   [testbytestring
24a0: 20 5c 78 41 30 5c 78 44 30 5d 0a 7d 20 31 0a 74   \xA0\xD0].} 1.t
24b0: 65 73 74 20 75 74 66 2d 36 2e 31 33 20 7b 54 63  est utf-6.13 {Tc
24c0: 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65 73 74  l_UtfNext} {test
24d0: 75 74 66 6e 65 78 74 20 74 65 73 74 62 79 74 65  utfnext testbyte
24e0: 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65  string} {.    te
24f0: 73 74 75 74 66 6e 65 78 74 20 5b 74 65 73 74 62  stutfnext [testb
2500: 79 74 65 73 74 72 69 6e 67 20 5c 78 41 30 5c 78  ytestring \xA0\x
2510: 45 38 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66  E8].} 1.test utf
2520: 2d 36 2e 31 34 20 7b 54 63 6c 5f 55 74 66 4e 65  -6.14 {Tcl_UtfNe
2530: 78 74 7d 20 7b 74 65 73 74 75 74 66 6e 65 78 74  xt} {testutfnext
2540: 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d   testbytestring}
2550: 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65   {.    testutfne
2560: 78 74 20 5b 74 65 73 74 62 79 74 65 73 74 72 69  xt [testbytestri
2570: 6e 67 20 5c 78 41 30 5c 78 46 32 5d 0a 7d 20 31  ng \xA0\xF2].} 1
2580: 0a 74 65 73 74 20 75 74 66 2d 36 2e 31 35 20 7b  .test utf-6.15 {
2590: 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65  Tcl_UtfNext} {te
25a0: 73 74 75 74 66 6e 65 78 74 20 74 65 73 74 62 79  stutfnext testby
25b0: 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20  testring} {.    
25c0: 74 65 73 74 75 74 66 6e 65 78 74 20 5b 74 65 73  testutfnext [tes
25d0: 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 41 30  tbytestring \xA0
25e0: 5c 78 46 38 5d 0a 7d 20 31 0a 74 65 73 74 20 75  \xF8].} 1.test u
25f0: 74 66 2d 36 2e 31 36 20 7b 54 63 6c 5f 55 74 66  tf-6.16 {Tcl_Utf
2600: 4e 65 78 74 7d 20 7b 74 65 73 74 75 74 66 6e 65  Next} {testutfne
2610: 78 74 20 74 65 73 74 62 79 74 65 73 74 72 69 6e  xt testbytestrin
2620: 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66  g} {.    testutf
2630: 6e 65 78 74 20 5b 74 65 73 74 62 79 74 65 73 74  next [testbytest
2640: 72 69 6e 67 20 5c 78 44 30 5c 78 30 30 5d 0a 7d  ring \xD0\x00].}
2650: 20 31 0a 74 65 73 74 20 75 74 66 2d 36 2e 31 37   1.test utf-6.17
2660: 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b   {Tcl_UtfNext} {
2670: 74 65 73 74 75 74 66 6e 65 78 74 20 74 65 73 74  testutfnext test
2680: 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20  bytestring} {.  
2690: 20 20 74 65 73 74 75 74 66 6e 65 78 74 20 5b 74    testutfnext [t
26a0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
26b0: 44 30 5d 47 0a 7d 20 31 0a 74 65 73 74 20 75 74  D0]G.} 1.test ut
26c0: 66 2d 36 2e 31 38 20 7b 54 63 6c 5f 55 74 66 4e  f-6.18 {Tcl_UtfN
26d0: 65 78 74 7d 20 7b 74 65 73 74 75 74 66 6e 65 78  ext} {testutfnex
26e0: 74 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  t testbytestring
26f0: 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e  } {.    testutfn
2700: 65 78 74 20 5b 74 65 73 74 62 79 74 65 73 74 72  ext [testbytestr
2710: 69 6e 67 20 5c 78 44 30 5c 78 41 30 5d 0a 7d 20  ing \xD0\xA0].} 
2720: 32 0a 74 65 73 74 20 75 74 66 2d 36 2e 31 39 20  2.test utf-6.19 
2730: 7b 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74  {Tcl_UtfNext} {t
2740: 65 73 74 75 74 66 6e 65 78 74 20 74 65 73 74 62  estutfnext testb
2750: 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20  ytestring} {.   
2760: 20 74 65 73 74 75 74 66 6e 65 78 74 20 5b 74 65   testutfnext [te
2770: 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 44  stbytestring \xD
2780: 30 5c 78 44 30 5d 0a 7d 20 31 0a 74 65 73 74 20  0\xD0].} 1.test 
2790: 75 74 66 2d 36 2e 32 30 20 7b 54 63 6c 5f 55 74  utf-6.20 {Tcl_Ut
27a0: 66 4e 65 78 74 7d 20 7b 74 65 73 74 75 74 66 6e  fNext} {testutfn
27b0: 65 78 74 20 74 65 73 74 62 79 74 65 73 74 72 69  ext testbytestri
27c0: 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74  ng} {.    testut
27d0: 66 6e 65 78 74 20 5b 74 65 73 74 62 79 74 65 73  fnext [testbytes
27e0: 74 72 69 6e 67 20 5c 78 44 30 5c 78 45 38 5d 0a  tring \xD0\xE8].
27f0: 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 36 2e 32  } 1.test utf-6.2
2800: 31 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20  1 {Tcl_UtfNext} 
2810: 7b 74 65 73 74 75 74 66 6e 65 78 74 20 74 65 73  {testutfnext tes
2820: 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20  tbytestring} {. 
2830: 20 20 20 74 65 73 74 75 74 66 6e 65 78 74 20 5b     testutfnext [
2840: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c  testbytestring \
2850: 78 44 30 5c 78 46 32 5d 0a 7d 20 31 0a 74 65 73  xD0\xF2].} 1.tes
2860: 74 20 75 74 66 2d 36 2e 32 32 20 7b 54 63 6c 5f  t utf-6.22 {Tcl_
2870: 55 74 66 4e 65 78 74 7d 20 7b 74 65 73 74 75 74  UtfNext} {testut
2880: 66 6e 65 78 74 20 74 65 73 74 62 79 74 65 73 74  fnext testbytest
2890: 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74  ring} {.    test
28a0: 75 74 66 6e 65 78 74 20 5b 74 65 73 74 62 79 74  utfnext [testbyt
28b0: 65 73 74 72 69 6e 67 20 5c 78 44 30 5c 78 46 38  estring \xD0\xF8
28c0: 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 36  ].} 1.test utf-6
28d0: 2e 32 33 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74  .23 {Tcl_UtfNext
28e0: 7d 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20 74  } {testutfnext t
28f0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
2900: 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65 78 74  .    testutfnext
2910: 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67   [testbytestring
2920: 20 5c 78 45 38 5d 0a 7d 20 31 0a 74 65 73 74 20   \xE8].} 1.test 
2930: 75 74 66 2d 36 2e 32 34 20 7b 54 63 6c 5f 55 74  utf-6.24 {Tcl_Ut
2940: 66 4e 65 78 74 7d 20 7b 74 65 73 74 75 74 66 6e  fNext} {testutfn
2950: 65 78 74 20 74 65 73 74 62 79 74 65 73 74 72 69  ext testbytestri
2960: 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74  ng} {.    testut
2970: 66 6e 65 78 74 20 5b 74 65 73 74 62 79 74 65 73  fnext [testbytes
2980: 74 72 69 6e 67 20 5c 78 45 38 5d 47 0a 7d 20 31  tring \xE8]G.} 1
2990: 0a 74 65 73 74 20 75 74 66 2d 36 2e 32 35 20 7b  .test utf-6.25 {
29a0: 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65  Tcl_UtfNext} {te
29b0: 73 74 75 74 66 6e 65 78 74 20 74 65 73 74 62 79  stutfnext testby
29c0: 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20  testring} {.    
29d0: 74 65 73 74 75 74 66 6e 65 78 74 20 5b 74 65 73  testutfnext [tes
29e0: 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 45 38  tbytestring \xE8
29f0: 5c 78 41 30 5c 78 30 30 5d 0a 7d 20 31 0a 74 65  \xA0\x00].} 1.te
2a00: 73 74 20 75 74 66 2d 36 2e 32 36 20 7b 54 63 6c  st utf-6.26 {Tcl
2a10: 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65 73 74 75  _UtfNext} {testu
2a20: 74 66 6e 65 78 74 20 74 65 73 74 62 79 74 65 73  tfnext testbytes
2a30: 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73  tring} {.    tes
2a40: 74 75 74 66 6e 65 78 74 20 5b 74 65 73 74 62 79  tutfnext [testby
2a50: 74 65 73 74 72 69 6e 67 20 5c 78 45 38 5c 78 44  testring \xE8\xD
2a60: 30 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d  0].} 1.test utf-
2a70: 36 2e 32 37 20 7b 54 63 6c 5f 55 74 66 4e 65 78  6.27 {Tcl_UtfNex
2a80: 74 7d 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20  t} {testutfnext 
2a90: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20  testbytestring} 
2aa0: 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65 78  {.    testutfnex
2ab0: 74 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e  t [testbytestrin
2ac0: 67 20 5c 78 45 38 5c 78 45 38 5d 0a 7d 20 31 0a  g \xE8\xE8].} 1.
2ad0: 74 65 73 74 20 75 74 66 2d 36 2e 32 38 20 7b 54  test utf-6.28 {T
2ae0: 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65 73  cl_UtfNext} {tes
2af0: 74 75 74 66 6e 65 78 74 20 74 65 73 74 62 79 74  tutfnext testbyt
2b00: 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74  estring} {.    t
2b10: 65 73 74 75 74 66 6e 65 78 74 20 5b 74 65 73 74  estutfnext [test
2b20: 62 79 74 65 73 74 72 69 6e 67 20 5c 78 45 38 5c  bytestring \xE8\
2b30: 78 46 32 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74  xF2].} 1.test ut
2b40: 66 2d 36 2e 32 39 20 7b 54 63 6c 5f 55 74 66 4e  f-6.29 {Tcl_UtfN
2b50: 65 78 74 7d 20 7b 74 65 73 74 75 74 66 6e 65 78  ext} {testutfnex
2b60: 74 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  t testbytestring
2b70: 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e  } {.    testutfn
2b80: 65 78 74 20 5b 74 65 73 74 62 79 74 65 73 74 72  ext [testbytestr
2b90: 69 6e 67 20 5c 78 45 38 5c 78 46 38 5d 0a 7d 20  ing \xE8\xF8].} 
2ba0: 31 0a 74 65 73 74 20 75 74 66 2d 36 2e 33 30 20  1.test utf-6.30 
2bb0: 7b 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74  {Tcl_UtfNext} {t
2bc0: 65 73 74 75 74 66 6e 65 78 74 20 74 65 73 74 62  estutfnext testb
2bd0: 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20  ytestring} {.   
2be0: 20 74 65 73 74 75 74 66 6e 65 78 74 20 5b 74 65   testutfnext [te
2bf0: 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46  stbytestring \xF
2c00: 32 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d  2].} 1.test utf-
2c10: 36 2e 33 31 20 7b 54 63 6c 5f 55 74 66 4e 65 78  6.31 {Tcl_UtfNex
2c20: 74 7d 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20  t} {testutfnext 
2c30: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20  testbytestring} 
2c40: 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65 78  {.    testutfnex
2c50: 74 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e  t [testbytestrin
2c60: 67 20 5c 78 46 32 5d 47 0a 7d 20 31 0a 74 65 73  g \xF2]G.} 1.tes
2c70: 74 20 75 74 66 2d 36 2e 33 32 20 7b 54 63 6c 5f  t utf-6.32 {Tcl_
2c80: 55 74 66 4e 65 78 74 7d 20 7b 74 65 73 74 75 74  UtfNext} {testut
2c90: 66 6e 65 78 74 20 74 65 73 74 62 79 74 65 73 74  fnext testbytest
2ca0: 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74  ring} {.    test
2cb0: 75 74 66 6e 65 78 74 20 5b 74 65 73 74 62 79 74  utfnext [testbyt
2cc0: 65 73 74 72 69 6e 67 20 5c 78 46 32 5c 78 41 30  estring \xF2\xA0
2cd0: 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 36  ].} 1.test utf-6
2ce0: 2e 33 33 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74  .33 {Tcl_UtfNext
2cf0: 7d 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20 74  } {testutfnext t
2d00: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
2d10: 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65 78 74  .    testutfnext
2d20: 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67   [testbytestring
2d30: 20 5c 78 46 32 5c 78 44 30 5d 0a 7d 20 31 0a 74   \xF2\xD0].} 1.t
2d40: 65 73 74 20 75 74 66 2d 36 2e 33 34 20 7b 54 63  est utf-6.34 {Tc
2d50: 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65 73 74  l_UtfNext} {test
2d60: 75 74 66 6e 65 78 74 20 74 65 73 74 62 79 74 65  utfnext testbyte
2d70: 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65  string} {.    te
2d80: 73 74 75 74 66 6e 65 78 74 20 5b 74 65 73 74 62  stutfnext [testb
2d90: 79 74 65 73 74 72 69 6e 67 20 5c 78 46 32 5c 78  ytestring \xF2\x
2da0: 45 38 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66  E8].} 1.test utf
2db0: 2d 36 2e 33 35 20 7b 54 63 6c 5f 55 74 66 4e 65  -6.35 {Tcl_UtfNe
2dc0: 78 74 7d 20 7b 74 65 73 74 75 74 66 6e 65 78 74  xt} {testutfnext
2dd0: 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d   testbytestring}
2de0: 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65   {.    testutfne
2df0: 78 74 20 5b 74 65 73 74 62 79 74 65 73 74 72 69  xt [testbytestri
2e00: 6e 67 20 5c 78 46 32 5c 78 46 32 5d 0a 7d 20 31  ng \xF2\xF2].} 1
2e10: 0a 74 65 73 74 20 75 74 66 2d 36 2e 33 36 20 7b  .test utf-6.36 {
2e20: 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65  Tcl_UtfNext} {te
2e30: 73 74 75 74 66 6e 65 78 74 20 74 65 73 74 62 79  stutfnext testby
2e40: 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20  testring} {.    
2e50: 74 65 73 74 75 74 66 6e 65 78 74 20 5b 74 65 73  testutfnext [tes
2e60: 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46 32  tbytestring \xF2
2e70: 5c 78 46 38 5d 0a 7d 20 31 0a 74 65 73 74 20 75  \xF8].} 1.test u
2e80: 74 66 2d 36 2e 33 37 20 7b 54 63 6c 5f 55 74 66  tf-6.37 {Tcl_Utf
2e90: 4e 65 78 74 7d 20 7b 74 65 73 74 75 74 66 6e 65  Next} {testutfne
2ea0: 78 74 20 74 65 73 74 62 79 74 65 73 74 72 69 6e  xt testbytestrin
2eb0: 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66  g} {.    testutf
2ec0: 6e 65 78 74 20 5b 74 65 73 74 62 79 74 65 73 74  next [testbytest
2ed0: 72 69 6e 67 20 5c 78 46 38 5d 0a 7d 20 31 0a 74  ring \xF8].} 1.t
2ee0: 65 73 74 20 75 74 66 2d 36 2e 33 38 20 7b 54 63  est utf-6.38 {Tc
2ef0: 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65 73 74  l_UtfNext} {test
2f00: 75 74 66 6e 65 78 74 20 74 65 73 74 62 79 74 65  utfnext testbyte
2f10: 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65  string} {.    te
2f20: 73 74 75 74 66 6e 65 78 74 20 5b 74 65 73 74 62  stutfnext [testb
2f30: 79 74 65 73 74 72 69 6e 67 20 5c 78 46 38 5d 47  ytestring \xF8]G
2f40: 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 36 2e  .} 1.test utf-6.
2f50: 33 39 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74 7d  39 {Tcl_UtfNext}
2f60: 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20 74 65   {testutfnext te
2f70: 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a  stbytestring} {.
2f80: 20 20 20 20 74 65 73 74 75 74 66 6e 65 78 74 20      testutfnext 
2f90: 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20  [testbytestring 
2fa0: 5c 78 46 38 5c 78 41 30 5d 0a 7d 20 31 0a 74 65  \xF8\xA0].} 1.te
2fb0: 73 74 20 75 74 66 2d 36 2e 34 30 20 7b 54 63 6c  st utf-6.40 {Tcl
2fc0: 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65 73 74 75  _UtfNext} {testu
2fd0: 74 66 6e 65 78 74 20 74 65 73 74 62 79 74 65 73  tfnext testbytes
2fe0: 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73  tring} {.    tes
2ff0: 74 75 74 66 6e 65 78 74 20 5b 74 65 73 74 62 79  tutfnext [testby
3000: 74 65 73 74 72 69 6e 67 20 5c 78 46 38 5c 78 44  testring \xF8\xD
3010: 30 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d  0].} 1.test utf-
3020: 36 2e 34 31 20 7b 54 63 6c 5f 55 74 66 4e 65 78  6.41 {Tcl_UtfNex
3030: 74 7d 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20  t} {testutfnext 
3040: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20  testbytestring} 
3050: 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65 78  {.    testutfnex
3060: 74 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e  t [testbytestrin
3070: 67 20 5c 78 46 38 5c 78 45 38 5d 0a 7d 20 31 0a  g \xF8\xE8].} 1.
3080: 74 65 73 74 20 75 74 66 2d 36 2e 34 32 20 7b 54  test utf-6.42 {T
3090: 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65 73  cl_UtfNext} {tes
30a0: 74 75 74 66 6e 65 78 74 20 74 65 73 74 62 79 74  tutfnext testbyt
30b0: 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74  estring} {.    t
30c0: 65 73 74 75 74 66 6e 65 78 74 20 5b 74 65 73 74  estutfnext [test
30d0: 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46 38 5c  bytestring \xF8\
30e0: 78 46 32 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74  xF2].} 1.test ut
30f0: 66 2d 36 2e 34 33 20 7b 54 63 6c 5f 55 74 66 4e  f-6.43 {Tcl_UtfN
3100: 65 78 74 7d 20 7b 74 65 73 74 75 74 66 6e 65 78  ext} {testutfnex
3110: 74 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  t testbytestring
3120: 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e  } {.    testutfn
3130: 65 78 74 20 5b 74 65 73 74 62 79 74 65 73 74 72  ext [testbytestr
3140: 69 6e 67 20 5c 78 46 38 5c 78 46 38 5d 0a 7d 20  ing \xF8\xF8].} 
3150: 31 0a 74 65 73 74 20 75 74 66 2d 36 2e 34 34 20  1.test utf-6.44 
3160: 7b 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74  {Tcl_UtfNext} {t
3170: 65 73 74 75 74 66 6e 65 78 74 20 74 65 73 74 62  estutfnext testb
3180: 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20  ytestring} {.   
3190: 20 74 65 73 74 75 74 66 6e 65 78 74 20 5b 74 65   testutfnext [te
31a0: 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 44  stbytestring \xD
31b0: 30 5c 78 41 30 5d 47 0a 7d 20 32 0a 74 65 73 74  0\xA0]G.} 2.test
31c0: 20 75 74 66 2d 36 2e 34 35 20 7b 54 63 6c 5f 55   utf-6.45 {Tcl_U
31d0: 74 66 4e 65 78 74 7d 20 7b 74 65 73 74 75 74 66  tfNext} {testutf
31e0: 6e 65 78 74 20 74 65 73 74 62 79 74 65 73 74 72  next testbytestr
31f0: 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75  ing} {.    testu
3200: 74 66 6e 65 78 74 20 5b 74 65 73 74 62 79 74 65  tfnext [testbyte
3210: 73 74 72 69 6e 67 20 5c 78 44 30 5c 78 41 30 5c  string \xD0\xA0\
3220: 78 41 30 5d 0a 7d 20 32 0a 74 65 73 74 20 75 74  xA0].} 2.test ut
3230: 66 2d 36 2e 34 36 20 7b 54 63 6c 5f 55 74 66 4e  f-6.46 {Tcl_UtfN
3240: 65 78 74 7d 20 7b 74 65 73 74 75 74 66 6e 65 78  ext} {testutfnex
3250: 74 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  t testbytestring
3260: 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e  } {.    testutfn
3270: 65 78 74 20 5b 74 65 73 74 62 79 74 65 73 74 72  ext [testbytestr
3280: 69 6e 67 20 5c 78 44 30 5c 78 41 30 5c 78 44 30  ing \xD0\xA0\xD0
3290: 5d 0a 7d 20 32 0a 74 65 73 74 20 75 74 66 2d 36  ].} 2.test utf-6
32a0: 2e 34 37 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74  .47 {Tcl_UtfNext
32b0: 7d 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20 74  } {testutfnext t
32c0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
32d0: 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65 78 74  .    testutfnext
32e0: 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67   [testbytestring
32f0: 20 5c 78 44 30 5c 78 41 30 5c 78 45 38 5d 0a 7d   \xD0\xA0\xE8].}
3300: 20 32 0a 74 65 73 74 20 75 74 66 2d 36 2e 34 38   2.test utf-6.48
3310: 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b   {Tcl_UtfNext} {
3320: 74 65 73 74 75 74 66 6e 65 78 74 20 74 65 73 74  testutfnext test
3330: 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20  bytestring} {.  
3340: 20 20 74 65 73 74 75 74 66 6e 65 78 74 20 5b 74    testutfnext [t
3350: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
3360: 44 30 5c 78 41 30 5c 78 46 32 5d 0a 7d 20 32 0a  D0\xA0\xF2].} 2.
3370: 74 65 73 74 20 75 74 66 2d 36 2e 34 39 20 7b 54  test utf-6.49 {T
3380: 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65 73  cl_UtfNext} {tes
3390: 74 75 74 66 6e 65 78 74 20 74 65 73 74 62 79 74  tutfnext testbyt
33a0: 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74  estring} {.    t
33b0: 65 73 74 75 74 66 6e 65 78 74 20 5b 74 65 73 74  estutfnext [test
33c0: 62 79 74 65 73 74 72 69 6e 67 20 5c 78 44 30 5c  bytestring \xD0\
33d0: 78 41 30 5c 78 46 38 5d 0a 7d 20 32 0a 74 65 73  xA0\xF8].} 2.tes
33e0: 74 20 75 74 66 2d 36 2e 35 30 20 7b 54 63 6c 5f  t utf-6.50 {Tcl_
33f0: 55 74 66 4e 65 78 74 7d 20 7b 74 65 73 74 75 74  UtfNext} {testut
3400: 66 6e 65 78 74 20 74 65 73 74 62 79 74 65 73 74  fnext testbytest
3410: 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74  ring} {.    test
3420: 75 74 66 6e 65 78 74 20 5b 74 65 73 74 62 79 74  utfnext [testbyt
3430: 65 73 74 72 69 6e 67 20 5c 78 45 38 5c 78 41 30  estring \xE8\xA0
3440: 5d 47 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d  ]G.} 1.test utf-
3450: 36 2e 35 31 20 7b 54 63 6c 5f 55 74 66 4e 65 78  6.51 {Tcl_UtfNex
3460: 74 7d 20 74 65 73 74 75 74 66 6e 65 78 74 20 7b  t} testutfnext {
3470: 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65 78 74  .    testutfnext
3480: 20 5c 75 38 38 32 30 0a 7d 20 33 0a 74 65 73 74   \u8820.} 3.test
3490: 20 75 74 66 2d 36 2e 35 32 20 7b 54 63 6c 5f 55   utf-6.52 {Tcl_U
34a0: 74 66 4e 65 78 74 7d 20 7b 74 65 73 74 75 74 66  tfNext} {testutf
34b0: 6e 65 78 74 20 74 65 73 74 62 79 74 65 73 74 72  next testbytestr
34c0: 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75  ing} {.    testu
34d0: 74 66 6e 65 78 74 20 5b 74 65 73 74 62 79 74 65  tfnext [testbyte
34e0: 73 74 72 69 6e 67 20 5c 78 45 38 5c 78 41 30 5c  string \xE8\xA0\
34f0: 78 44 30 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74  xD0].} 1.test ut
3500: 66 2d 36 2e 35 33 20 7b 54 63 6c 5f 55 74 66 4e  f-6.53 {Tcl_UtfN
3510: 65 78 74 7d 20 7b 74 65 73 74 75 74 66 6e 65 78  ext} {testutfnex
3520: 74 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  t testbytestring
3530: 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e  } {.    testutfn
3540: 65 78 74 20 5b 74 65 73 74 62 79 74 65 73 74 72  ext [testbytestr
3550: 69 6e 67 20 5c 78 45 38 5c 78 41 30 5c 78 45 38  ing \xE8\xA0\xE8
3560: 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 36  ].} 1.test utf-6
3570: 2e 35 34 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74  .54 {Tcl_UtfNext
3580: 7d 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20 74  } {testutfnext t
3590: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
35a0: 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65 78 74  .    testutfnext
35b0: 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67   [testbytestring
35c0: 20 5c 78 45 38 5c 78 41 30 5c 78 46 32 5d 0a 7d   \xE8\xA0\xF2].}
35d0: 20 31 0a 74 65 73 74 20 75 74 66 2d 36 2e 35 35   1.test utf-6.55
35e0: 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b   {Tcl_UtfNext} {
35f0: 74 65 73 74 75 74 66 6e 65 78 74 20 74 65 73 74  testutfnext test
3600: 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20  bytestring} {.  
3610: 20 20 74 65 73 74 75 74 66 6e 65 78 74 20 5b 74    testutfnext [t
3620: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
3630: 45 38 5c 78 41 30 5c 78 46 38 5d 0a 7d 20 31 0a  E8\xA0\xF8].} 1.
3640: 74 65 73 74 20 75 74 66 2d 36 2e 35 36 20 7b 54  test utf-6.56 {T
3650: 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65 73  cl_UtfNext} {tes
3660: 74 75 74 66 6e 65 78 74 20 74 65 73 74 62 79 74  tutfnext testbyt
3670: 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74  estring} {.    t
3680: 65 73 74 75 74 66 6e 65 78 74 20 5b 74 65 73 74  estutfnext [test
3690: 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46 32 5c  bytestring \xF2\
36a0: 78 41 30 5d 47 0a 7d 20 31 0a 74 65 73 74 20 75  xA0]G.} 1.test u
36b0: 74 66 2d 36 2e 35 37 20 7b 54 63 6c 5f 55 74 66  tf-6.57 {Tcl_Utf
36c0: 4e 65 78 74 7d 20 7b 74 65 73 74 75 74 66 6e 65  Next} {testutfne
36d0: 78 74 20 74 65 73 74 62 79 74 65 73 74 72 69 6e  xt testbytestrin
36e0: 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66  g} {.    testutf
36f0: 6e 65 78 74 20 5b 74 65 73 74 62 79 74 65 73 74  next [testbytest
3700: 72 69 6e 67 20 5c 78 46 32 5c 78 41 30 5c 78 41  ring \xF2\xA0\xA
3710: 30 5c 78 30 30 5d 0a 7d 20 31 0a 74 65 73 74 20  0\x00].} 1.test 
3720: 75 74 66 2d 36 2e 35 38 20 7b 54 63 6c 5f 55 74  utf-6.58 {Tcl_Ut
3730: 66 4e 65 78 74 7d 20 7b 74 65 73 74 75 74 66 6e  fNext} {testutfn
3740: 65 78 74 20 74 65 73 74 62 79 74 65 73 74 72 69  ext testbytestri
3750: 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74  ng} {.    testut
3760: 66 6e 65 78 74 20 5b 74 65 73 74 62 79 74 65 73  fnext [testbytes
3770: 74 72 69 6e 67 20 5c 78 46 32 5c 78 41 30 5c 78  tring \xF2\xA0\x
3780: 44 30 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66  D0].} 1.test utf
3790: 2d 36 2e 35 39 20 7b 54 63 6c 5f 55 74 66 4e 65  -6.59 {Tcl_UtfNe
37a0: 78 74 7d 20 7b 74 65 73 74 75 74 66 6e 65 78 74  xt} {testutfnext
37b0: 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d   testbytestring}
37c0: 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65   {.    testutfne
37d0: 78 74 20 5b 74 65 73 74 62 79 74 65 73 74 72 69  xt [testbytestri
37e0: 6e 67 20 5c 78 46 32 5c 78 41 30 5c 78 45 38 5d  ng \xF2\xA0\xE8]
37f0: 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 36 2e  .} 1.test utf-6.
3800: 36 30 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74 7d  60 {Tcl_UtfNext}
3810: 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20 74 65   {testutfnext te
3820: 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a  stbytestring} {.
3830: 20 20 20 20 74 65 73 74 75 74 66 6e 65 78 74 20      testutfnext 
3840: 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20  [testbytestring 
3850: 5c 78 46 32 5c 78 41 30 5c 78 46 32 5d 0a 7d 20  \xF2\xA0\xF2].} 
3860: 31 0a 74 65 73 74 20 75 74 66 2d 36 2e 36 31 20  1.test utf-6.61 
3870: 7b 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74  {Tcl_UtfNext} {t
3880: 65 73 74 75 74 66 6e 65 78 74 20 74 65 73 74 62  estutfnext testb
3890: 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20  ytestring} {.   
38a0: 20 74 65 73 74 75 74 66 6e 65 78 74 20 5b 74 65   testutfnext [te
38b0: 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46  stbytestring \xF
38c0: 32 5c 78 41 30 5c 78 46 38 5d 0a 7d 20 31 0a 74  2\xA0\xF8].} 1.t
38d0: 65 73 74 20 75 74 66 2d 36 2e 36 32 20 7b 54 63  est utf-6.62 {Tc
38e0: 6c 5f 55 74 66 4e 65 78 74 7d 20 74 65 73 74 75  l_UtfNext} testu
38f0: 74 66 6e 65 78 74 20 7b 0a 20 20 20 20 74 65 73  tfnext {.    tes
3900: 74 75 74 66 6e 65 78 74 20 5c 75 38 38 32 30 47  tutfnext \u8820G
3910: 0a 7d 20 33 0a 74 65 73 74 20 75 74 66 2d 36 2e  .} 3.test utf-6.
3920: 36 33 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74 7d  63 {Tcl_UtfNext}
3930: 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20 74 65   {testutfnext te
3940: 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a  stbytestring} {.
3950: 20 20 20 20 74 65 73 74 75 74 66 6e 65 78 74 20      testutfnext 
3960: 5c 75 38 38 32 30 5b 74 65 73 74 62 79 74 65 73  \u8820[testbytes
3970: 74 72 69 6e 67 20 5c 78 41 30 5d 0a 7d 20 33 0a  tring \xA0].} 3.
3980: 74 65 73 74 20 75 74 66 2d 36 2e 36 34 20 7b 54  test utf-6.64 {T
3990: 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65 73  cl_UtfNext} {tes
39a0: 74 75 74 66 6e 65 78 74 20 74 65 73 74 62 79 74  tutfnext testbyt
39b0: 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74  estring} {.    t
39c0: 65 73 74 75 74 66 6e 65 78 74 20 5c 75 38 38 32  estutfnext \u882
39d0: 30 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  0[testbytestring
39e0: 20 5c 78 44 30 5d 0a 7d 20 33 0a 74 65 73 74 20   \xD0].} 3.test 
39f0: 75 74 66 2d 36 2e 36 35 20 7b 54 63 6c 5f 55 74  utf-6.65 {Tcl_Ut
3a00: 66 4e 65 78 74 7d 20 7b 74 65 73 74 75 74 66 6e  fNext} {testutfn
3a10: 65 78 74 20 74 65 73 74 62 79 74 65 73 74 72 69  ext testbytestri
3a20: 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74  ng} {.    testut
3a30: 66 6e 65 78 74 20 5c 75 38 38 32 30 5b 74 65 73  fnext \u8820[tes
3a40: 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 45 38  tbytestring \xE8
3a50: 5d 0a 7d 20 33 0a 74 65 73 74 20 75 74 66 2d 36  ].} 3.test utf-6
3a60: 2e 36 36 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74  .66 {Tcl_UtfNext
3a70: 7d 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20 74  } {testutfnext t
3a80: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
3a90: 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65 78 74  .    testutfnext
3aa0: 20 5c 75 38 38 32 30 5b 74 65 73 74 62 79 74 65   \u8820[testbyte
3ab0: 73 74 72 69 6e 67 20 5c 78 46 32 5d 0a 7d 20 33  string \xF2].} 3
3ac0: 0a 74 65 73 74 20 75 74 66 2d 36 2e 36 37 20 7b  .test utf-6.67 {
3ad0: 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65  Tcl_UtfNext} {te
3ae0: 73 74 75 74 66 6e 65 78 74 20 74 65 73 74 62 79  stutfnext testby
3af0: 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20  testring} {.    
3b00: 74 65 73 74 75 74 66 6e 65 78 74 20 5c 75 38 38  testutfnext \u88
3b10: 32 30 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e  20[testbytestrin
3b20: 67 20 5c 78 46 38 5d 0a 7d 20 33 0a 74 65 73 74  g \xF8].} 3.test
3b30: 20 75 74 66 2d 36 2e 36 38 20 7b 54 63 6c 5f 55   utf-6.68 {Tcl_U
3b40: 74 66 4e 65 78 74 7d 20 7b 74 65 73 74 75 74 66  tfNext} {testutf
3b50: 6e 65 78 74 20 74 65 73 74 62 79 74 65 73 74 72  next testbytestr
3b60: 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75  ing} {.    testu
3b70: 74 66 6e 65 78 74 20 5b 74 65 73 74 62 79 74 65  tfnext [testbyte
3b80: 73 74 72 69 6e 67 20 5c 78 46 32 5c 78 41 30 5c  string \xF2\xA0\
3b90: 78 41 30 5d 47 0a 7d 20 31 0a 74 65 73 74 20 75  xA0]G.} 1.test u
3ba0: 74 66 2d 36 2e 36 39 2e 30 20 7b 54 63 6c 5f 55  tf-6.69.0 {Tcl_U
3bb0: 74 66 4e 65 78 74 7d 20 7b 74 65 73 74 75 74 66  tfNext} {testutf
3bc0: 6e 65 78 74 20 74 69 70 33 38 39 7d 20 7b 0a 20  next tip389} {. 
3bd0: 20 20 20 74 65 73 74 75 74 66 6e 65 78 74 20 5b     testutfnext [
3be0: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c  testbytestring \
3bf0: 78 46 32 5c 78 41 30 5c 78 41 30 5c 78 41 30 5d  xF2\xA0\xA0\xA0]
3c00: 0a 7d 20 34 0a 74 65 73 74 20 75 74 66 2d 36 2e  .} 4.test utf-6.
3c10: 36 39 2e 31 20 7b 54 63 6c 5f 55 74 66 4e 65 78  69.1 {Tcl_UtfNex
3c20: 74 7d 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20  t} {testutfnext 
3c30: 75 63 73 34 7d 20 7b 0a 20 20 20 20 74 65 73 74  ucs4} {.    test
3c40: 75 74 66 6e 65 78 74 20 5b 74 65 73 74 62 79 74  utfnext [testbyt
3c50: 65 73 74 72 69 6e 67 20 5c 78 46 32 5c 78 41 30  estring \xF2\xA0
3c60: 5c 78 41 30 5c 78 41 30 5d 0a 7d 20 34 0a 74 65  \xA0\xA0].} 4.te
3c70: 73 74 20 75 74 66 2d 36 2e 37 30 20 7b 54 63 6c  st utf-6.70 {Tcl
3c80: 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65 73 74 75  _UtfNext} {testu
3c90: 74 66 6e 65 78 74 20 74 65 73 74 62 79 74 65 73  tfnext testbytes
3ca0: 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73  tring} {.    tes
3cb0: 74 75 74 66 6e 65 78 74 20 5b 74 65 73 74 62 79  tutfnext [testby
3cc0: 74 65 73 74 72 69 6e 67 20 5c 78 46 32 5c 78 41  testring \xF2\xA
3cd0: 30 5c 78 41 30 5c 78 44 30 5d 0a 7d 20 31 0a 74  0\xA0\xD0].} 1.t
3ce0: 65 73 74 20 75 74 66 2d 36 2e 37 31 20 7b 54 63  est utf-6.71 {Tc
3cf0: 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65 73 74  l_UtfNext} {test
3d00: 75 74 66 6e 65 78 74 20 74 65 73 74 62 79 74 65  utfnext testbyte
3d10: 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65  string} {.    te
3d20: 73 74 75 74 66 6e 65 78 74 20 5b 74 65 73 74 62  stutfnext [testb
3d30: 79 74 65 73 74 72 69 6e 67 20 5c 78 46 32 5c 78  ytestring \xF2\x
3d40: 41 30 5c 78 41 30 5c 78 45 38 5d 0a 7d 20 31 0a  A0\xA0\xE8].} 1.
3d50: 74 65 73 74 20 75 74 66 2d 36 2e 37 32 20 7b 54  test utf-6.72 {T
3d60: 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65 73  cl_UtfNext} {tes
3d70: 74 75 74 66 6e 65 78 74 20 74 65 73 74 62 79 74  tutfnext testbyt
3d80: 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74  estring} {.    t
3d90: 65 73 74 75 74 66 6e 65 78 74 20 5b 74 65 73 74  estutfnext [test
3da0: 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46 32 5c  bytestring \xF2\
3db0: 78 41 30 5c 78 41 30 5c 78 46 32 5d 0a 7d 20 31  xA0\xA0\xF2].} 1
3dc0: 0a 74 65 73 74 20 75 74 66 2d 36 2e 37 33 20 7b  .test utf-6.73 {
3dd0: 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65  Tcl_UtfNext} {te
3de0: 73 74 75 74 66 6e 65 78 74 20 74 65 73 74 62 79  stutfnext testby
3df0: 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20  testring} {.    
3e00: 74 65 73 74 75 74 66 6e 65 78 74 20 5b 74 65 73  testutfnext [tes
3e10: 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46 32  tbytestring \xF2
3e20: 5c 78 41 30 5c 78 41 30 5c 78 46 38 5d 0a 7d 20  \xA0\xA0\xF8].} 
3e30: 31 0a 74 65 73 74 20 75 74 66 2d 36 2e 37 34 2e  1.test utf-6.74.
3e40: 30 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20  0 {Tcl_UtfNext} 
3e50: 7b 74 65 73 74 75 74 66 6e 65 78 74 20 74 69 70  {testutfnext tip
3e60: 33 38 39 7d 20 7b 0a 20 20 20 20 74 65 73 74 75  389} {.    testu
3e70: 74 66 6e 65 78 74 20 5b 74 65 73 74 62 79 74 65  tfnext [testbyte
3e80: 73 74 72 69 6e 67 20 5c 78 46 32 5c 78 41 30 5c  string \xF2\xA0\
3e90: 78 41 30 5c 78 41 30 5d 47 0a 7d 20 34 0a 74 65  xA0\xA0]G.} 4.te
3ea0: 73 74 20 75 74 66 2d 36 2e 37 34 2e 31 20 7b 54  st utf-6.74.1 {T
3eb0: 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65 73  cl_UtfNext} {tes
3ec0: 74 75 74 66 6e 65 78 74 20 75 63 73 34 7d 20 7b  tutfnext ucs4} {
3ed0: 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65 78 74  .    testutfnext
3ee0: 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67   [testbytestring
3ef0: 20 5c 78 46 32 5c 78 41 30 5c 78 41 30 5c 78 41   \xF2\xA0\xA0\xA
3f00: 30 5d 47 0a 7d 20 34 0a 74 65 73 74 20 75 74 66  0]G.} 4.test utf
3f10: 2d 36 2e 37 35 2e 30 20 7b 54 63 6c 5f 55 74 66  -6.75.0 {Tcl_Utf
3f20: 4e 65 78 74 7d 20 7b 74 65 73 74 75 74 66 6e 65  Next} {testutfne
3f30: 78 74 20 74 69 70 33 38 39 7d 20 7b 0a 20 20 20  xt tip389} {.   
3f40: 20 74 65 73 74 75 74 66 6e 65 78 74 20 5b 74 65   testutfnext [te
3f50: 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46  stbytestring \xF
3f60: 32 5c 78 41 30 5c 78 41 30 5c 78 41 30 5c 78 41  2\xA0\xA0\xA0\xA
3f70: 30 5d 0a 7d 20 34 0a 74 65 73 74 20 75 74 66 2d  0].} 4.test utf-
3f80: 36 2e 37 35 2e 31 20 7b 54 63 6c 5f 55 74 66 4e  6.75.1 {Tcl_UtfN
3f90: 65 78 74 7d 20 7b 74 65 73 74 75 74 66 6e 65 78  ext} {testutfnex
3fa0: 74 20 75 63 73 34 7d 20 7b 0a 20 20 20 20 74 65  t ucs4} {.    te
3fb0: 73 74 75 74 66 6e 65 78 74 20 5b 74 65 73 74 62  stutfnext [testb
3fc0: 79 74 65 73 74 72 69 6e 67 20 5c 78 46 32 5c 78  ytestring \xF2\x
3fd0: 41 30 5c 78 41 30 5c 78 41 30 5c 78 41 30 5d 0a  A0\xA0\xA0\xA0].
3fe0: 7d 20 34 0a 74 65 73 74 20 75 74 66 2d 36 2e 37  } 4.test utf-6.7
3ff0: 36 2e 30 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74  6.0 {Tcl_UtfNext
4000: 7d 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20 74  } {testutfnext t
4010: 69 70 33 38 39 7d 20 7b 0a 20 20 20 20 74 65 73  ip389} {.    tes
4020: 74 75 74 66 6e 65 78 74 20 5b 74 65 73 74 62 79  tutfnext [testby
4030: 74 65 73 74 72 69 6e 67 20 5c 78 46 32 5c 78 41  testring \xF2\xA
4040: 30 5c 78 41 30 5c 78 41 30 5c 78 44 30 5d 0a 7d  0\xA0\xA0\xD0].}
4050: 20 34 0a 74 65 73 74 20 75 74 66 2d 36 2e 37 36   4.test utf-6.76
4060: 2e 31 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74 7d  .1 {Tcl_UtfNext}
4070: 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20 75 63   {testutfnext uc
4080: 73 34 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74  s4} {.    testut
4090: 66 6e 65 78 74 20 5b 74 65 73 74 62 79 74 65 73  fnext [testbytes
40a0: 74 72 69 6e 67 20 5c 78 46 32 5c 78 41 30 5c 78  tring \xF2\xA0\x
40b0: 41 30 5c 78 41 30 5c 78 44 30 5d 0a 7d 20 34 0a  A0\xA0\xD0].} 4.
40c0: 74 65 73 74 20 75 74 66 2d 36 2e 37 37 2e 30 20  test utf-6.77.0 
40d0: 7b 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74  {Tcl_UtfNext} {t
40e0: 65 73 74 75 74 66 6e 65 78 74 20 74 69 70 33 38  estutfnext tip38
40f0: 39 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66  9} {.    testutf
4100: 6e 65 78 74 20 5b 74 65 73 74 62 79 74 65 73 74  next [testbytest
4110: 72 69 6e 67 20 5c 78 46 32 5c 78 41 30 5c 78 41  ring \xF2\xA0\xA
4120: 30 5c 78 41 30 5c 78 45 38 5d 0a 7d 20 34 0a 74  0\xA0\xE8].} 4.t
4130: 65 73 74 20 75 74 66 2d 36 2e 37 37 2e 31 20 7b  est utf-6.77.1 {
4140: 54 63 6c 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65  Tcl_UtfNext} {te
4150: 73 74 75 74 66 6e 65 78 74 20 75 63 73 34 7d 20  stutfnext ucs4} 
4160: 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65 78  {.    testutfnex
4170: 74 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e  t [testbytestrin
4180: 67 20 5c 78 46 32 5c 78 41 30 5c 78 41 30 5c 78  g \xF2\xA0\xA0\x
4190: 41 30 5c 78 45 38 5d 0a 7d 20 34 0a 74 65 73 74  A0\xE8].} 4.test
41a0: 20 75 74 66 2d 36 2e 37 38 2e 30 20 7b 54 63 6c   utf-6.78.0 {Tcl
41b0: 5f 55 74 66 4e 65 78 74 7d 20 7b 74 65 73 74 75  _UtfNext} {testu
41c0: 74 66 6e 65 78 74 20 74 69 70 33 38 39 7d 20 7b  tfnext tip389} {
41d0: 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65 78 74  .    testutfnext
41e0: 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67   [testbytestring
41f0: 20 5c 78 46 32 5c 78 41 30 5c 78 41 30 5c 78 41   \xF2\xA0\xA0\xA
4200: 30 5c 78 46 32 5d 0a 7d 20 34 0a 74 65 73 74 20  0\xF2].} 4.test 
4210: 75 74 66 2d 36 2e 37 38 2e 31 20 7b 54 63 6c 5f  utf-6.78.1 {Tcl_
4220: 55 74 66 4e 65 78 74 7d 20 7b 74 65 73 74 75 74  UtfNext} {testut
4230: 66 6e 65 78 74 20 75 63 73 34 7d 20 7b 0a 20 20  fnext ucs4} {.  
4240: 20 20 74 65 73 74 75 74 66 6e 65 78 74 20 5b 74    testutfnext [t
4250: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
4260: 46 32 5c 78 41 30 5c 78 41 30 5c 78 41 30 5c 78  F2\xA0\xA0\xA0\x
4270: 46 32 5d 0a 7d 20 34 0a 74 65 73 74 20 75 74 66  F2].} 4.test utf
4280: 2d 36 2e 37 39 2e 30 20 7b 54 63 6c 5f 55 74 66  -6.79.0 {Tcl_Utf
4290: 4e 65 78 74 7d 20 7b 74 65 73 74 75 74 66 6e 65  Next} {testutfne
42a0: 78 74 20 74 69 70 33 38 39 7d 20 7b 0a 20 20 20  xt tip389} {.   
42b0: 20 74 65 73 74 75 74 66 6e 65 78 74 20 5b 74 65   testutfnext [te
42c0: 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46  stbytestring \xF
42d0: 32 5c 78 41 30 5c 78 41 30 5c 78 41 30 47 5c 78  2\xA0\xA0\xA0G\x
42e0: 46 38 5d 0a 7d 20 34 0a 74 65 73 74 20 75 74 66  F8].} 4.test utf
42f0: 2d 36 2e 37 39 2e 31 20 7b 54 63 6c 5f 55 74 66  -6.79.1 {Tcl_Utf
4300: 4e 65 78 74 7d 20 7b 74 65 73 74 75 74 66 6e 65  Next} {testutfne
4310: 78 74 20 75 63 73 34 7d 20 7b 0a 20 20 20 20 74  xt ucs4} {.    t
4320: 65 73 74 75 74 66 6e 65 78 74 20 5b 74 65 73 74  estutfnext [test
4330: 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46 32 5c  bytestring \xF2\
4340: 78 41 30 5c 78 41 30 5c 78 41 30 47 5c 78 46 38  xA0\xA0\xA0G\xF8
4350: 5d 0a 7d 20 34 0a 74 65 73 74 20 75 74 66 2d 36  ].} 4.test utf-6
4360: 2e 38 30 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74  .80 {Tcl_UtfNext
4370: 20 2d 20 6f 76 65 72 6c 6f 6e 67 20 73 65 71 75   - overlong sequ
4380: 65 6e 63 65 73 7d 20 7b 74 65 73 74 75 74 66 6e  ences} {testutfn
4390: 65 78 74 20 74 65 73 74 62 79 74 65 73 74 72 69  ext testbytestri
43a0: 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74  ng} {.    testut
43b0: 66 6e 65 78 74 20 5b 74 65 73 74 62 79 74 65 73  fnext [testbytes
43c0: 74 72 69 6e 67 20 5c 78 43 30 5c 78 38 30 5d 0a  tring \xC0\x80].
43d0: 7d 20 32 0a 74 65 73 74 20 75 74 66 2d 36 2e 38  } 2.test utf-6.8
43e0: 31 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74 20 2d  1 {Tcl_UtfNext -
43f0: 20 6f 76 65 72 6c 6f 6e 67 20 73 65 71 75 65 6e   overlong sequen
4400: 63 65 73 7d 20 7b 74 65 73 74 75 74 66 6e 65 78  ces} {testutfnex
4410: 74 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  t testbytestring
4420: 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e  } {.    testutfn
4430: 65 78 74 20 5b 74 65 73 74 62 79 74 65 73 74 72  ext [testbytestr
4440: 69 6e 67 20 5c 78 43 30 5c 78 38 31 5d 0a 7d 20  ing \xC0\x81].} 
4450: 31 0a 74 65 73 74 20 75 74 66 2d 36 2e 38 32 20  1.test utf-6.82 
4460: 7b 54 63 6c 5f 55 74 66 4e 65 78 74 20 2d 20 6f  {Tcl_UtfNext - o
4470: 76 65 72 6c 6f 6e 67 20 73 65 71 75 65 6e 63 65  verlong sequence
4480: 73 7d 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20  s} {testutfnext 
4490: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20  testbytestring} 
44a0: 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65 78  {.    testutfnex
44b0: 74 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e  t [testbytestrin
44c0: 67 20 5c 78 43 31 5c 78 38 30 5d 0a 7d 20 31 0a  g \xC1\x80].} 1.
44d0: 74 65 73 74 20 75 74 66 2d 36 2e 38 33 20 7b 54  test utf-6.83 {T
44e0: 63 6c 5f 55 74 66 4e 65 78 74 20 2d 20 6f 76 65  cl_UtfNext - ove
44f0: 72 6c 6f 6e 67 20 73 65 71 75 65 6e 63 65 73 7d  rlong sequences}
4500: 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20 74 65   {testutfnext te
4510: 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a  stbytestring} {.
4520: 20 20 20 20 74 65 73 74 75 74 66 6e 65 78 74 20      testutfnext 
4530: 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20  [testbytestring 
4540: 5c 78 43 32 5c 78 38 30 5d 0a 7d 20 32 0a 74 65  \xC2\x80].} 2.te
4550: 73 74 20 75 74 66 2d 36 2e 38 34 20 7b 54 63 6c  st utf-6.84 {Tcl
4560: 5f 55 74 66 4e 65 78 74 20 2d 20 6f 76 65 72 6c  _UtfNext - overl
4570: 6f 6e 67 20 73 65 71 75 65 6e 63 65 73 7d 20 7b  ong sequences} {
4580: 74 65 73 74 75 74 66 6e 65 78 74 20 74 65 73 74  testutfnext test
4590: 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20  bytestring} {.  
45a0: 20 20 74 65 73 74 75 74 66 6e 65 78 74 20 5b 74    testutfnext [t
45b0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
45c0: 45 30 5c 78 38 30 5c 78 38 30 5d 0a 7d 20 31 0a  E0\x80\x80].} 1.
45d0: 74 65 73 74 20 75 74 66 2d 36 2e 38 35 20 7b 54  test utf-6.85 {T
45e0: 63 6c 5f 55 74 66 4e 65 78 74 20 2d 20 6f 76 65  cl_UtfNext - ove
45f0: 72 6c 6f 6e 67 20 73 65 71 75 65 6e 63 65 73 7d  rlong sequences}
4600: 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20 74 65   {testutfnext te
4610: 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a  stbytestring} {.
4620: 20 20 20 20 74 65 73 74 75 74 66 6e 65 78 74 20      testutfnext 
4630: 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20  [testbytestring 
4640: 5c 78 45 30 5c 78 41 30 5c 78 38 30 5d 0a 7d 20  \xE0\xA0\x80].} 
4650: 33 0a 74 65 73 74 20 75 74 66 2d 36 2e 38 36 20  3.test utf-6.86 
4660: 7b 54 63 6c 5f 55 74 66 4e 65 78 74 20 2d 20 6f  {Tcl_UtfNext - o
4670: 76 65 72 6c 6f 6e 67 20 73 65 71 75 65 6e 63 65  verlong sequence
4680: 73 7d 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20  s} {testutfnext 
4690: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20  testbytestring} 
46a0: 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65 78  {.    testutfnex
46b0: 74 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e  t [testbytestrin
46c0: 67 20 5c 78 46 30 5c 78 38 30 5c 78 38 30 5c 78  g \xF0\x80\x80\x
46d0: 38 30 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66  80].} 1.test utf
46e0: 2d 36 2e 38 37 2e 30 20 7b 54 63 6c 5f 55 74 66  -6.87.0 {Tcl_Utf
46f0: 4e 65 78 74 20 2d 20 6f 76 65 72 6c 6f 6e 67 20  Next - overlong 
4700: 73 65 71 75 65 6e 63 65 73 7d 20 7b 74 65 73 74  sequences} {test
4710: 75 74 66 6e 65 78 74 20 74 69 70 33 38 39 7d 20  utfnext tip389} 
4720: 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65 78  {.    testutfnex
4730: 74 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e  t [testbytestrin
4740: 67 20 5c 78 46 30 5c 78 39 30 5c 78 38 30 5c 78  g \xF0\x90\x80\x
4750: 38 30 5d 0a 7d 20 34 0a 74 65 73 74 20 75 74 66  80].} 4.test utf
4760: 2d 36 2e 38 37 2e 31 20 7b 54 63 6c 5f 55 74 66  -6.87.1 {Tcl_Utf
4770: 4e 65 78 74 20 2d 20 6f 76 65 72 6c 6f 6e 67 20  Next - overlong 
4780: 73 65 71 75 65 6e 63 65 73 7d 20 7b 74 65 73 74  sequences} {test
4790: 75 74 66 6e 65 78 74 20 75 63 73 34 7d 20 7b 0a  utfnext ucs4} {.
47a0: 20 20 20 20 74 65 73 74 75 74 66 6e 65 78 74 20      testutfnext 
47b0: 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20  [testbytestring 
47c0: 5c 78 46 30 5c 78 39 30 5c 78 38 30 5c 78 38 30  \xF0\x90\x80\x80
47d0: 5d 0a 7d 20 34 0a 74 65 73 74 20 75 74 66 2d 36  ].} 4.test utf-6
47e0: 2e 38 38 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74  .88 {Tcl_UtfNext
47f0: 2c 20 70 6f 69 6e 74 69 6e 67 20 74 6f 20 32 74  , pointing to 2t
4800: 68 20 62 79 74 65 20 6f 66 20 33 2d 62 79 74 65  h byte of 3-byte
4810: 20 76 61 6c 69 64 20 73 65 71 75 65 6e 63 65 7d   valid sequence}
4820: 20 7b 74 65 73 74 75 74 66 6e 65 78 74 20 74 65   {testutfnext te
4830: 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a  stbytestring} {.
4840: 20 20 20 20 74 65 73 74 75 74 66 6e 65 78 74 20      testutfnext 
4850: 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20  [testbytestring 
4860: 5c 78 41 30 5c 78 41 30 5c 78 30 30 5d 0a 7d 20  \xA0\xA0\x00].} 
4870: 32 0a 74 65 73 74 20 75 74 66 2d 36 2e 38 39 20  2.test utf-6.89 
4880: 7b 54 63 6c 5f 55 74 66 4e 65 78 74 2c 20 70 6f  {Tcl_UtfNext, po
4890: 69 6e 74 69 6e 67 20 74 6f 20 32 74 68 20 62 79  inting to 2th by
48a0: 74 65 20 6f 66 20 33 2d 62 79 74 65 20 69 6e 76  te of 3-byte inv
48b0: 61 6c 69 64 20 73 65 71 75 65 6e 63 65 7d 20 7b  alid sequence} {
48c0: 74 65 73 74 75 74 66 6e 65 78 74 20 74 65 73 74  testutfnext test
48d0: 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20  bytestring} {.  
48e0: 20 20 74 65 73 74 75 74 66 6e 65 78 74 20 5b 74    testutfnext [t
48f0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
4900: 38 30 5c 78 38 30 5c 78 30 30 5d 0a 7d 20 32 0a  80\x80\x00].} 2.
4910: 74 65 73 74 20 75 74 66 2d 36 2e 39 30 2e 30 20  test utf-6.90.0 
4920: 7b 54 63 6c 5f 55 74 66 4e 65 78 74 2c 20 76 61  {Tcl_UtfNext, va
4930: 6c 69 64 69 74 79 20 63 68 65 63 6b 20 5b 34 39  lidity check [49
4940: 33 64 63 63 63 32 64 65 5d 7d 20 7b 74 65 73 74  3dccc2de]} {test
4950: 75 74 66 6e 65 78 74 20 74 69 70 33 38 39 7d 20  utfnext tip389} 
4960: 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65 78  {.    testutfnex
4970: 74 20 5c 75 44 42 46 46 5c 75 44 46 46 46 0a 7d  t \uDBFF\uDFFF.}
4980: 20 34 0a 74 65 73 74 20 75 74 66 2d 36 2e 39 30   4.test utf-6.90
4990: 2e 31 20 7b 54 63 6c 5f 55 74 66 4e 65 78 74 2c  .1 {Tcl_UtfNext,
49a0: 20 76 61 6c 69 64 69 74 79 20 63 68 65 63 6b 20   validity check 
49b0: 5b 34 39 33 64 63 63 63 32 64 65 5d 7d 20 7b 74  [493dccc2de]} {t
49c0: 65 73 74 75 74 66 6e 65 78 74 20 75 63 73 34 7d  estutfnext ucs4}
49d0: 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e 65   {.    testutfne
49e0: 78 74 20 5c 55 31 30 46 46 46 46 0a 7d 20 34 0a  xt \U10FFFF.} 4.
49f0: 74 65 73 74 20 75 74 66 2d 36 2e 39 31 20 7b 54  test utf-6.91 {T
4a00: 63 6c 5f 55 74 66 4e 65 78 74 2c 20 76 61 6c 69  cl_UtfNext, vali
4a10: 64 69 74 79 20 63 68 65 63 6b 20 5b 34 39 33 64  dity check [493d
4a20: 63 63 63 32 64 65 5d 7d 20 7b 74 65 73 74 75 74  ccc2de]} {testut
4a30: 66 6e 65 78 74 20 74 65 73 74 62 79 74 65 73 74  fnext testbytest
4a40: 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74  ring} {.    test
4a50: 75 74 66 6e 65 78 74 20 5b 74 65 73 74 62 79 74  utfnext [testbyt
4a60: 65 73 74 72 69 6e 67 20 5c 78 46 34 5c 78 39 30  estring \xF4\x90
4a70: 5c 78 38 30 5c 78 38 30 5d 0a 7d 20 31 0a 74 65  \x80\x80].} 1.te
4a80: 73 74 20 75 74 66 2d 36 2e 39 32 20 7b 54 63 6c  st utf-6.92 {Tcl
4a90: 5f 55 74 66 4e 65 78 74 2c 20 70 6f 69 6e 74 69  _UtfNext, pointi
4aa0: 6e 67 20 74 6f 20 32 74 68 20 62 79 74 65 20 6f  ng to 2th byte o
4ab0: 66 20 34 2d 62 79 74 65 20 76 61 6c 69 64 20 73  f 4-byte valid s
4ac0: 65 71 75 65 6e 63 65 7d 20 7b 74 65 73 74 75 74  equence} {testut
4ad0: 66 6e 65 78 74 20 74 65 73 74 62 79 74 65 73 74  fnext testbytest
4ae0: 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74  ring} {.    test
4af0: 75 74 66 6e 65 78 74 20 5b 74 65 73 74 62 79 74  utfnext [testbyt
4b00: 65 73 74 72 69 6e 67 20 5c 78 41 30 5c 78 41 30  estring \xA0\xA0
4b10: 5c 78 41 30 5d 0a 7d 20 33 0a 74 65 73 74 20 75  \xA0].} 3.test u
4b20: 74 66 2d 36 2e 39 33 20 7b 54 63 6c 5f 55 74 66  tf-6.93 {Tcl_Utf
4b30: 4e 65 78 74 2c 20 70 6f 69 6e 74 69 6e 67 20 74  Next, pointing t
4b40: 6f 20 32 74 68 20 62 79 74 65 20 6f 66 20 34 2d  o 2th byte of 4-
4b50: 62 79 74 65 20 69 6e 76 61 6c 69 64 20 73 65 71  byte invalid seq
4b60: 75 65 6e 63 65 7d 20 7b 74 65 73 74 75 74 66 6e  uence} {testutfn
4b70: 65 78 74 20 74 65 73 74 62 79 74 65 73 74 72 69  ext testbytestri
4b80: 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74  ng} {.    testut
4b90: 66 6e 65 78 74 20 5b 74 65 73 74 62 79 74 65 73  fnext [testbytes
4ba0: 74 72 69 6e 67 20 5c 78 38 30 5c 78 38 30 5c 78  tring \x80\x80\x
4bb0: 38 30 5d 0a 7d 20 33 0a 74 65 73 74 20 75 74 66  80].} 3.test utf
4bc0: 2d 36 2e 39 34 20 7b 54 63 6c 5f 55 74 66 4e 65  -6.94 {Tcl_UtfNe
4bd0: 78 74 2c 20 70 6f 69 6e 74 69 6e 67 20 74 6f 20  xt, pointing to 
4be0: 32 74 68 20 62 79 74 65 20 6f 66 20 35 2d 62 79  2th byte of 5-by
4bf0: 74 65 20 69 6e 76 61 6c 69 64 20 73 65 71 75 65  te invalid seque
4c00: 6e 63 65 7d 20 7b 74 65 73 74 75 74 66 6e 65 78  nce} {testutfnex
4c10: 74 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  t testbytestring
4c20: 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 6e  } {.    testutfn
4c30: 65 78 74 20 5b 74 65 73 74 62 79 74 65 73 74 72  ext [testbytestr
4c40: 69 6e 67 20 5c 78 41 30 5c 78 41 30 5c 78 41 30  ing \xA0\xA0\xA0
4c50: 5c 78 41 30 5d 0a 7d 20 33 0a 74 65 73 74 20 75  \xA0].} 3.test u
4c60: 74 66 2d 36 2e 39 35 20 7b 54 63 6c 5f 55 74 66  tf-6.95 {Tcl_Utf
4c70: 4e 65 78 74 2c 20 70 6f 69 6e 74 69 6e 67 20 74  Next, pointing t
4c80: 6f 20 32 74 68 20 62 79 74 65 20 6f 66 20 35 2d  o 2th byte of 5-
4c90: 62 79 74 65 20 69 6e 76 61 6c 69 64 20 73 65 71  byte invalid seq
4ca0: 75 65 6e 63 65 7d 20 7b 74 65 73 74 75 74 66 6e  uence} {testutfn
4cb0: 65 78 74 20 74 65 73 74 62 79 74 65 73 74 72 69  ext testbytestri
4cc0: 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74  ng} {.    testut
4cd0: 66 6e 65 78 74 20 5b 74 65 73 74 62 79 74 65 73  fnext [testbytes
4ce0: 74 72 69 6e 67 20 5c 78 38 30 5c 78 38 30 5c 78  tring \x80\x80\x
4cf0: 38 30 5c 78 38 30 5d 0a 7d 20 33 0a 0a 74 65 73  80\x80].} 3..tes
4d00: 74 20 75 74 66 2d 37 2e 31 20 7b 54 63 6c 5f 55  t utf-7.1 {Tcl_U
4d10: 74 66 50 72 65 76 7d 20 74 65 73 74 75 74 66 70  tfPrev} testutfp
4d20: 72 65 76 20 7b 0a 20 20 20 20 74 65 73 74 75 74  rev {.    testut
4d30: 66 70 72 65 76 20 7b 7d 0a 7d 20 30 0a 74 65 73  fprev {}.} 0.tes
4d40: 74 20 75 74 66 2d 37 2e 32 20 7b 54 63 6c 5f 55  t utf-7.2 {Tcl_U
4d50: 74 66 50 72 65 76 7d 20 74 65 73 74 75 74 66 70  tfPrev} testutfp
4d60: 72 65 76 20 7b 0a 20 20 20 20 74 65 73 74 75 74  rev {.    testut
4d70: 66 70 72 65 76 20 41 0a 7d 20 30 0a 74 65 73 74  fprev A.} 0.test
4d80: 20 75 74 66 2d 37 2e 33 20 7b 54 63 6c 5f 55 74   utf-7.3 {Tcl_Ut
4d90: 66 50 72 65 76 7d 20 74 65 73 74 75 74 66 70 72  fPrev} testutfpr
4da0: 65 76 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66  ev {.    testutf
4db0: 70 72 65 76 20 41 41 0a 7d 20 31 0a 74 65 73 74  prev AA.} 1.test
4dc0: 20 75 74 66 2d 37 2e 34 20 7b 54 63 6c 5f 55 74   utf-7.4 {Tcl_Ut
4dd0: 66 50 72 65 76 7d 20 7b 74 65 73 74 75 74 66 70  fPrev} {testutfp
4de0: 72 65 76 20 74 65 73 74 62 79 74 65 73 74 72 69  rev testbytestri
4df0: 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74  ng} {.    testut
4e00: 66 70 72 65 76 20 41 5b 74 65 73 74 62 79 74 65  fprev A[testbyte
4e10: 73 74 72 69 6e 67 20 5c 78 46 38 5d 0a 7d 20 31  string \xF8].} 1
4e20: 0a 74 65 73 74 20 75 74 66 2d 37 2e 34 2e 31 20  .test utf-7.4.1 
4e30: 7b 54 63 6c 5f 55 74 66 50 72 65 76 7d 20 7b 74  {Tcl_UtfPrev} {t
4e40: 65 73 74 75 74 66 70 72 65 76 20 74 65 73 74 62  estutfprev testb
4e50: 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20  ytestring} {.   
4e60: 20 74 65 73 74 75 74 66 70 72 65 76 20 41 5b 74   testutfprev A[t
4e70: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
4e80: 46 38 5c 78 41 30 5c 78 41 30 5c 78 41 30 5d 20  F8\xA0\xA0\xA0] 
4e90: 32 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 37  2.} 1.test utf-7
4ea0: 2e 34 2e 32 20 7b 54 63 6c 5f 55 74 66 50 72 65  .4.2 {Tcl_UtfPre
4eb0: 76 7d 20 7b 74 65 73 74 75 74 66 70 72 65 76 20  v} {testutfprev 
4ec0: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20  testbytestring} 
4ed0: 7b 0a 20 20 20 20 74 65 73 74 75 74 66 70 72 65  {.    testutfpre
4ee0: 76 20 41 5b 74 65 73 74 62 79 74 65 73 74 72 69  v A[testbytestri
4ef0: 6e 67 20 5c 78 46 38 5c 78 46 38 5c 78 41 30 5c  ng \xF8\xF8\xA0\
4f00: 78 41 30 5d 20 32 0a 7d 20 31 0a 74 65 73 74 20  xA0] 2.} 1.test 
4f10: 75 74 66 2d 37 2e 35 20 7b 54 63 6c 5f 55 74 66  utf-7.5 {Tcl_Utf
4f20: 50 72 65 76 7d 20 7b 74 65 73 74 75 74 66 70 72  Prev} {testutfpr
4f30: 65 76 20 74 65 73 74 62 79 74 65 73 74 72 69 6e  ev testbytestrin
4f40: 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66  g} {.    testutf
4f50: 70 72 65 76 20 41 5b 74 65 73 74 62 79 74 65 73  prev A[testbytes
4f60: 74 72 69 6e 67 20 5c 78 46 32 5d 0a 7d 20 31 0a  tring \xF2].} 1.
4f70: 74 65 73 74 20 75 74 66 2d 37 2e 35 2e 31 20 7b  test utf-7.5.1 {
4f80: 54 63 6c 5f 55 74 66 50 72 65 76 7d 20 7b 74 65  Tcl_UtfPrev} {te
4f90: 73 74 75 74 66 70 72 65 76 20 74 65 73 74 62 79  stutfprev testby
4fa0: 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20  testring} {.    
4fb0: 74 65 73 74 75 74 66 70 72 65 76 20 41 5b 74 65  testutfprev A[te
4fc0: 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46  stbytestring \xF
4fd0: 32 5c 78 41 30 5c 78 41 30 5c 78 41 30 5d 20 32  2\xA0\xA0\xA0] 2
4fe0: 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 37 2e  .} 1.test utf-7.
4ff0: 35 2e 32 20 7b 54 63 6c 5f 55 74 66 50 72 65 76  5.2 {Tcl_UtfPrev
5000: 7d 20 7b 74 65 73 74 75 74 66 70 72 65 76 20 74  } {testutfprev t
5010: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
5020: 0a 20 20 20 20 74 65 73 74 75 74 66 70 72 65 76  .    testutfprev
5030: 20 41 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e   A[testbytestrin
5040: 67 20 5c 78 46 32 5c 78 46 38 5c 78 41 30 5c 78  g \xF2\xF8\xA0\x
5050: 41 30 5d 20 32 0a 7d 20 31 0a 74 65 73 74 20 75  A0] 2.} 1.test u
5060: 74 66 2d 37 2e 36 20 7b 54 63 6c 5f 55 74 66 50  tf-7.6 {Tcl_UtfP
5070: 72 65 76 7d 20 7b 74 65 73 74 75 74 66 70 72 65  rev} {testutfpre
5080: 76 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  v testbytestring
5090: 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 70  } {.    testutfp
50a0: 72 65 76 20 41 5b 74 65 73 74 62 79 74 65 73 74  rev A[testbytest
50b0: 72 69 6e 67 20 5c 78 45 38 5d 0a 7d 20 31 0a 74  ring \xE8].} 1.t
50c0: 65 73 74 20 75 74 66 2d 37 2e 36 2e 31 20 7b 54  est utf-7.6.1 {T
50d0: 63 6c 5f 55 74 66 50 72 65 76 7d 20 7b 74 65 73  cl_UtfPrev} {tes
50e0: 74 75 74 66 70 72 65 76 20 74 65 73 74 62 79 74  tutfprev testbyt
50f0: 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74  estring} {.    t
5100: 65 73 74 75 74 66 70 72 65 76 20 41 5c 75 38 38  estutfprev A\u88
5110: 32 30 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e  20[testbytestrin
5120: 67 20 5c 78 41 30 5d 20 32 0a 7d 20 31 0a 74 65  g \xA0] 2.} 1.te
5130: 73 74 20 75 74 66 2d 37 2e 36 2e 32 20 7b 54 63  st utf-7.6.2 {Tc
5140: 6c 5f 55 74 66 50 72 65 76 7d 20 7b 74 65 73 74  l_UtfPrev} {test
5150: 75 74 66 70 72 65 76 20 74 65 73 74 62 79 74 65  utfprev testbyte
5160: 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65  string} {.    te
5170: 73 74 75 74 66 70 72 65 76 20 41 5b 74 65 73 74  stutfprev A[test
5180: 62 79 74 65 73 74 72 69 6e 67 20 5c 78 45 38 5c  bytestring \xE8\
5190: 78 46 38 5c 78 41 30 5c 78 41 30 5d 20 32 0a 7d  xF8\xA0\xA0] 2.}
51a0: 20 31 0a 74 65 73 74 20 75 74 66 2d 37 2e 37 20   1.test utf-7.7 
51b0: 7b 54 63 6c 5f 55 74 66 50 72 65 76 7d 20 7b 74  {Tcl_UtfPrev} {t
51c0: 65 73 74 75 74 66 70 72 65 76 20 74 65 73 74 62  estutfprev testb
51d0: 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20  ytestring} {.   
51e0: 20 74 65 73 74 75 74 66 70 72 65 76 20 41 5b 74   testutfprev A[t
51f0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
5200: 44 30 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66  D0].} 1.test utf
5210: 2d 37 2e 37 2e 31 20 7b 54 63 6c 5f 55 74 66 50  -7.7.1 {Tcl_UtfP
5220: 72 65 76 7d 20 7b 74 65 73 74 75 74 66 70 72 65  rev} {testutfpre
5230: 76 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  v testbytestring
5240: 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 70  } {.    testutfp
5250: 72 65 76 20 41 5b 74 65 73 74 62 79 74 65 73 74  rev A[testbytest
5260: 72 69 6e 67 20 5c 78 44 30 5c 78 41 30 5c 78 41  ring \xD0\xA0\xA
5270: 30 5c 78 41 30 5d 20 32 0a 7d 20 31 0a 74 65 73  0\xA0] 2.} 1.tes
5280: 74 20 75 74 66 2d 37 2e 37 2e 32 20 7b 54 63 6c  t utf-7.7.2 {Tcl
5290: 5f 55 74 66 50 72 65 76 7d 20 7b 74 65 73 74 75  _UtfPrev} {testu
52a0: 74 66 70 72 65 76 20 74 65 73 74 62 79 74 65 73  tfprev testbytes
52b0: 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73  tring} {.    tes
52c0: 74 75 74 66 70 72 65 76 20 41 5b 74 65 73 74 62  tutfprev A[testb
52d0: 79 74 65 73 74 72 69 6e 67 20 5c 78 44 30 5c 78  ytestring \xD0\x
52e0: 46 38 5c 78 41 30 5c 78 41 30 5d 20 32 0a 7d 20  F8\xA0\xA0] 2.} 
52f0: 31 0a 74 65 73 74 20 75 74 66 2d 37 2e 38 20 7b  1.test utf-7.8 {
5300: 54 63 6c 5f 55 74 66 50 72 65 76 7d 20 7b 74 65  Tcl_UtfPrev} {te
5310: 73 74 75 74 66 70 72 65 76 20 74 65 73 74 62 79  stutfprev testby
5320: 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20  testring} {.    
5330: 74 65 73 74 75 74 66 70 72 65 76 20 41 5b 74 65  testutfprev A[te
5340: 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 41  stbytestring \xA
5350: 30 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d  0].} 1.test utf-
5360: 37 2e 38 2e 31 20 7b 54 63 6c 5f 55 74 66 50 72  7.8.1 {Tcl_UtfPr
5370: 65 76 7d 20 7b 74 65 73 74 75 74 66 70 72 65 76  ev} {testutfprev
5380: 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d   testbytestring}
5390: 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 70 72   {.    testutfpr
53a0: 65 76 20 41 5b 74 65 73 74 62 79 74 65 73 74 72  ev A[testbytestr
53b0: 69 6e 67 20 5c 78 41 30 5c 78 41 30 5c 78 41 30  ing \xA0\xA0\xA0
53c0: 5c 78 41 30 5d 20 32 0a 7d 20 31 0a 74 65 73 74  \xA0] 2.} 1.test
53d0: 20 75 74 66 2d 37 2e 38 2e 32 20 7b 54 63 6c 5f   utf-7.8.2 {Tcl_
53e0: 55 74 66 50 72 65 76 7d 20 7b 74 65 73 74 75 74  UtfPrev} {testut
53f0: 66 70 72 65 76 20 74 65 73 74 62 79 74 65 73 74  fprev testbytest
5400: 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74  ring} {.    test
5410: 75 74 66 70 72 65 76 20 41 5b 74 65 73 74 62 79  utfprev A[testby
5420: 74 65 73 74 72 69 6e 67 20 5c 78 41 30 5c 78 46  testring \xA0\xF
5430: 38 5c 78 41 30 5c 78 41 30 5d 20 32 0a 7d 20 31  8\xA0\xA0] 2.} 1
5440: 0a 74 65 73 74 20 75 74 66 2d 37 2e 39 20 7b 54  .test utf-7.9 {T
5450: 63 6c 5f 55 74 66 50 72 65 76 7d 20 7b 74 65 73  cl_UtfPrev} {tes
5460: 74 75 74 66 70 72 65 76 20 74 65 73 74 62 79 74  tutfprev testbyt
5470: 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74  estring} {.    t
5480: 65 73 74 75 74 66 70 72 65 76 20 41 5b 74 65 73  estutfprev A[tes
5490: 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46 38  tbytestring \xF8
54a0: 5c 78 41 30 5d 0a 7d 20 32 0a 74 65 73 74 20 75  \xA0].} 2.test u
54b0: 74 66 2d 37 2e 39 2e 31 20 7b 54 63 6c 5f 55 74  tf-7.9.1 {Tcl_Ut
54c0: 66 50 72 65 76 7d 20 7b 74 65 73 74 75 74 66 70  fPrev} {testutfp
54d0: 72 65 76 20 74 65 73 74 62 79 74 65 73 74 72 69  rev testbytestri
54e0: 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74  ng} {.    testut
54f0: 66 70 72 65 76 20 41 5b 74 65 73 74 62 79 74 65  fprev A[testbyte
5500: 73 74 72 69 6e 67 20 5c 78 46 38 5c 78 41 30 5c  string \xF8\xA0\
5510: 78 41 30 5c 78 41 30 5d 20 33 0a 7d 20 32 0a 74  xA0\xA0] 3.} 2.t
5520: 65 73 74 20 75 74 66 2d 37 2e 39 2e 32 20 7b 54  est utf-7.9.2 {T
5530: 63 6c 5f 55 74 66 50 72 65 76 7d 20 7b 74 65 73  cl_UtfPrev} {tes
5540: 74 75 74 66 70 72 65 76 20 74 65 73 74 62 79 74  tutfprev testbyt
5550: 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74  estring} {.    t
5560: 65 73 74 75 74 66 70 72 65 76 20 41 5b 74 65 73  estutfprev A[tes
5570: 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46 38  tbytestring \xF8
5580: 5c 78 41 30 5c 78 46 38 5c 78 41 30 5d 20 33 0a  \xA0\xF8\xA0] 3.
5590: 7d 20 32 0a 74 65 73 74 20 75 74 66 2d 37 2e 31  } 2.test utf-7.1
55a0: 30 2e 30 20 7b 54 63 6c 5f 55 74 66 50 72 65 76  0.0 {Tcl_UtfPrev
55b0: 7d 20 7b 74 65 73 74 75 74 66 70 72 65 76 20 74  } {testutfprev t
55c0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 74 69  estbytestring ti
55d0: 70 33 38 39 7d 20 7b 0a 20 20 20 20 74 65 73 74  p389} {.    test
55e0: 75 74 66 70 72 65 76 20 41 5b 74 65 73 74 62 79  utfprev A[testby
55f0: 74 65 73 74 72 69 6e 67 20 5c 78 46 32 5c 78 41  testring \xF2\xA
5600: 30 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d  0].} 1.test utf-
5610: 37 2e 31 30 2e 31 20 7b 54 63 6c 5f 55 74 66 50  7.10.1 {Tcl_UtfP
5620: 72 65 76 7d 20 7b 74 65 73 74 75 74 66 70 72 65  rev} {testutfpre
5630: 76 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  v testbytestring
5640: 20 75 63 73 34 7d 20 7b 0a 20 20 20 20 74 65 73   ucs4} {.    tes
5650: 74 75 74 66 70 72 65 76 20 41 5b 74 65 73 74 62  tutfprev A[testb
5660: 79 74 65 73 74 72 69 6e 67 20 5c 78 46 32 5c 78  ytestring \xF2\x
5670: 41 30 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66  A0].} 1.test utf
5680: 2d 37 2e 31 30 2e 32 20 7b 54 63 6c 5f 55 74 66  -7.10.2 {Tcl_Utf
5690: 50 72 65 76 7d 20 7b 74 65 73 74 75 74 66 70 72  Prev} {testutfpr
56a0: 65 76 20 74 65 73 74 62 79 74 65 73 74 72 69 6e  ev testbytestrin
56b0: 67 20 74 69 70 33 38 39 7d 20 7b 0a 20 20 20 20  g tip389} {.    
56c0: 74 65 73 74 75 74 66 70 72 65 76 20 41 5b 74 65  testutfprev A[te
56d0: 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46  stbytestring \xF
56e0: 32 5c 78 41 30 5c 78 41 30 5c 78 41 30 5d 20 33  2\xA0\xA0\xA0] 3
56f0: 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 37 2e  .} 1.test utf-7.
5700: 31 30 2e 33 20 7b 54 63 6c 5f 55 74 66 50 72 65  10.3 {Tcl_UtfPre
5710: 76 7d 20 7b 74 65 73 74 75 74 66 70 72 65 76 20  v} {testutfprev 
5720: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 75  testbytestring u
5730: 63 73 34 7d 20 7b 0a 20 20 20 20 74 65 73 74 75  cs4} {.    testu
5740: 74 66 70 72 65 76 20 41 5b 74 65 73 74 62 79 74  tfprev A[testbyt
5750: 65 73 74 72 69 6e 67 20 5c 78 46 32 5c 78 41 30  estring \xF2\xA0
5760: 5c 78 41 30 5c 78 41 30 5d 20 33 0a 7d 20 31 0a  \xA0\xA0] 3.} 1.
5770: 74 65 73 74 20 75 74 66 2d 37 2e 31 30 2e 34 20  test utf-7.10.4 
5780: 7b 54 63 6c 5f 55 74 66 50 72 65 76 7d 20 7b 74  {Tcl_UtfPrev} {t
5790: 65 73 74 75 74 66 70 72 65 76 20 74 65 73 74 62  estutfprev testb
57a0: 79 74 65 73 74 72 69 6e 67 20 74 69 70 33 38 39  ytestring tip389
57b0: 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 70  } {.    testutfp
57c0: 72 65 76 20 41 5b 74 65 73 74 62 79 74 65 73 74  rev A[testbytest
57d0: 72 69 6e 67 20 5c 78 46 32 5c 78 41 30 5c 78 46  ring \xF2\xA0\xF
57e0: 38 5c 78 41 30 5d 20 33 0a 7d 20 31 0a 74 65 73  8\xA0] 3.} 1.tes
57f0: 74 20 75 74 66 2d 37 2e 31 30 2e 35 20 7b 54 63  t utf-7.10.5 {Tc
5800: 6c 5f 55 74 66 50 72 65 76 7d 20 7b 74 65 73 74  l_UtfPrev} {test
5810: 75 74 66 70 72 65 76 20 74 65 73 74 62 79 74 65  utfprev testbyte
5820: 73 74 72 69 6e 67 20 75 63 73 34 7d 20 7b 0a 20  string ucs4} {. 
5830: 20 20 20 74 65 73 74 75 74 66 70 72 65 76 20 41     testutfprev A
5840: 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20  [testbytestring 
5850: 5c 78 46 32 5c 78 41 30 5c 78 46 38 5c 78 41 30  \xF2\xA0\xF8\xA0
5860: 5d 20 33 0a 7d 20 31 0a 74 65 73 74 20 75 74 66  ] 3.} 1.test utf
5870: 2d 37 2e 31 31 20 7b 54 63 6c 5f 55 74 66 50 72  -7.11 {Tcl_UtfPr
5880: 65 76 7d 20 7b 74 65 73 74 75 74 66 70 72 65 76  ev} {testutfprev
5890: 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d   testbytestring}
58a0: 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 70 72   {.    testutfpr
58b0: 65 76 20 41 5b 74 65 73 74 62 79 74 65 73 74 72  ev A[testbytestr
58c0: 69 6e 67 20 5c 78 45 38 5c 78 41 30 5d 0a 7d 20  ing \xE8\xA0].} 
58d0: 31 0a 74 65 73 74 20 75 74 66 2d 37 2e 31 31 2e  1.test utf-7.11.
58e0: 31 20 7b 54 63 6c 5f 55 74 66 50 72 65 76 7d 20  1 {Tcl_UtfPrev} 
58f0: 7b 74 65 73 74 75 74 66 70 72 65 76 20 74 65 73  {testutfprev tes
5900: 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20  tbytestring} {. 
5910: 20 20 20 74 65 73 74 75 74 66 70 72 65 76 20 41     testutfprev A
5920: 5c 75 38 38 32 30 5b 74 65 73 74 62 79 74 65 73  \u8820[testbytes
5930: 74 72 69 6e 67 20 5c 78 41 30 5d 20 33 0a 7d 20  tring \xA0] 3.} 
5940: 31 0a 74 65 73 74 20 75 74 66 2d 37 2e 31 31 2e  1.test utf-7.11.
5950: 32 20 7b 54 63 6c 5f 55 74 66 50 72 65 76 7d 20  2 {Tcl_UtfPrev} 
5960: 7b 74 65 73 74 75 74 66 70 72 65 76 20 74 65 73  {testutfprev tes
5970: 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20  tbytestring} {. 
5980: 20 20 20 74 65 73 74 75 74 66 70 72 65 76 20 41     testutfprev A
5990: 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20  [testbytestring 
59a0: 5c 78 45 38 5c 78 41 30 5c 78 46 38 5c 78 41 30  \xE8\xA0\xF8\xA0
59b0: 5d 20 33 0a 7d 20 31 0a 74 65 73 74 20 75 74 66  ] 3.} 1.test utf
59c0: 2d 37 2e 31 31 2e 33 20 7b 54 63 6c 5f 55 74 66  -7.11.3 {Tcl_Utf
59d0: 50 72 65 76 7d 20 7b 74 65 73 74 75 74 66 70 72  Prev} {testutfpr
59e0: 65 76 20 74 65 73 74 62 79 74 65 73 74 72 69 6e  ev testbytestrin
59f0: 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66  g} {.    testutf
5a00: 70 72 65 76 20 41 5b 74 65 73 74 62 79 74 65 73  prev A[testbytes
5a10: 74 72 69 6e 67 20 5c 78 45 38 5c 78 41 30 5c 78  tring \xE8\xA0\x
5a20: 46 38 5d 20 33 0a 7d 20 31 0a 74 65 73 74 20 75  F8] 3.} 1.test u
5a30: 74 66 2d 37 2e 31 32 20 7b 54 63 6c 5f 55 74 66  tf-7.12 {Tcl_Utf
5a40: 50 72 65 76 7d 20 7b 74 65 73 74 75 74 66 70 72  Prev} {testutfpr
5a50: 65 76 20 74 65 73 74 62 79 74 65 73 74 72 69 6e  ev testbytestrin
5a60: 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66  g} {.    testutf
5a70: 70 72 65 76 20 41 5b 74 65 73 74 62 79 74 65 73  prev A[testbytes
5a80: 74 72 69 6e 67 20 5c 78 44 30 5c 78 41 30 5d 0a  tring \xD0\xA0].
5a90: 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 37 2e 31  } 1.test utf-7.1
5aa0: 32 2e 31 20 7b 54 63 6c 5f 55 74 66 50 72 65 76  2.1 {Tcl_UtfPrev
5ab0: 7d 20 7b 74 65 73 74 75 74 66 70 72 65 76 20 74  } {testutfprev t
5ac0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
5ad0: 0a 20 20 20 20 74 65 73 74 75 74 66 70 72 65 76  .    testutfprev
5ae0: 20 41 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e   A[testbytestrin
5af0: 67 20 5c 78 44 30 5c 78 41 30 5c 78 41 30 5c 78  g \xD0\xA0\xA0\x
5b00: 41 30 5d 20 33 0a 7d 20 31 0a 74 65 73 74 20 75  A0] 3.} 1.test u
5b10: 74 66 2d 37 2e 31 32 2e 32 20 7b 54 63 6c 5f 55  tf-7.12.2 {Tcl_U
5b20: 74 66 50 72 65 76 7d 20 7b 74 65 73 74 75 74 66  tfPrev} {testutf
5b30: 70 72 65 76 20 74 65 73 74 62 79 74 65 73 74 72  prev testbytestr
5b40: 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75  ing} {.    testu
5b50: 74 66 70 72 65 76 20 41 5b 74 65 73 74 62 79 74  tfprev A[testbyt
5b60: 65 73 74 72 69 6e 67 20 5c 78 44 30 5c 78 41 30  estring \xD0\xA0
5b70: 5c 78 46 38 5c 78 41 30 5d 20 33 0a 7d 20 31 0a  \xF8\xA0] 3.} 1.
5b80: 74 65 73 74 20 75 74 66 2d 37 2e 31 33 20 7b 54  test utf-7.13 {T
5b90: 63 6c 5f 55 74 66 50 72 65 76 7d 20 7b 74 65 73  cl_UtfPrev} {tes
5ba0: 74 75 74 66 70 72 65 76 20 74 65 73 74 62 79 74  tutfprev testbyt
5bb0: 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74  estring} {.    t
5bc0: 65 73 74 75 74 66 70 72 65 76 20 41 5b 74 65 73  estutfprev A[tes
5bd0: 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 41 30  tbytestring \xA0
5be0: 5c 78 41 30 5d 0a 7d 20 32 0a 74 65 73 74 20 75  \xA0].} 2.test u
5bf0: 74 66 2d 37 2e 31 33 2e 31 20 7b 54 63 6c 5f 55  tf-7.13.1 {Tcl_U
5c00: 74 66 50 72 65 76 7d 20 7b 74 65 73 74 75 74 66  tfPrev} {testutf
5c10: 70 72 65 76 20 74 65 73 74 62 79 74 65 73 74 72  prev testbytestr
5c20: 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75  ing} {.    testu
5c30: 74 66 70 72 65 76 20 41 5b 74 65 73 74 62 79 74  tfprev A[testbyt
5c40: 65 73 74 72 69 6e 67 20 5c 78 41 30 5c 78 41 30  estring \xA0\xA0
5c50: 5c 78 41 30 5c 78 41 30 5d 20 33 0a 7d 20 32 0a  \xA0\xA0] 3.} 2.
5c60: 74 65 73 74 20 75 74 66 2d 37 2e 31 33 2e 32 20  test utf-7.13.2 
5c70: 7b 54 63 6c 5f 55 74 66 50 72 65 76 7d 20 7b 74  {Tcl_UtfPrev} {t
5c80: 65 73 74 75 74 66 70 72 65 76 20 74 65 73 74 62  estutfprev testb
5c90: 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20  ytestring} {.   
5ca0: 20 74 65 73 74 75 74 66 70 72 65 76 20 41 5b 74   testutfprev A[t
5cb0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
5cc0: 41 30 5c 78 41 30 5c 78 46 38 5c 78 41 30 5d 20  A0\xA0\xF8\xA0] 
5cd0: 33 0a 7d 20 32 0a 74 65 73 74 20 75 74 66 2d 37  3.} 2.test utf-7
5ce0: 2e 31 34 20 7b 54 63 6c 5f 55 74 66 50 72 65 76  .14 {Tcl_UtfPrev
5cf0: 7d 20 7b 74 65 73 74 75 74 66 70 72 65 76 20 74  } {testutfprev t
5d00: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
5d10: 0a 20 20 20 20 74 65 73 74 75 74 66 70 72 65 76  .    testutfprev
5d20: 20 41 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e   A[testbytestrin
5d30: 67 20 5c 78 46 38 5c 78 41 30 5c 78 41 30 5d 0a  g \xF8\xA0\xA0].
5d40: 7d 20 33 0a 74 65 73 74 20 75 74 66 2d 37 2e 31  } 3.test utf-7.1
5d50: 34 2e 31 20 7b 54 63 6c 5f 55 74 66 50 72 65 76  4.1 {Tcl_UtfPrev
5d60: 7d 20 7b 74 65 73 74 75 74 66 70 72 65 76 20 74  } {testutfprev t
5d70: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
5d80: 0a 20 20 20 20 74 65 73 74 75 74 66 70 72 65 76  .    testutfprev
5d90: 20 41 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e   A[testbytestrin
5da0: 67 20 5c 78 46 38 5c 78 41 30 5c 78 41 30 5c 78  g \xF8\xA0\xA0\x
5db0: 41 30 5d 20 34 0a 7d 20 33 0a 74 65 73 74 20 75  A0] 4.} 3.test u
5dc0: 74 66 2d 37 2e 31 34 2e 32 20 7b 54 63 6c 5f 55  tf-7.14.2 {Tcl_U
5dd0: 74 66 50 72 65 76 7d 20 7b 74 65 73 74 75 74 66  tfPrev} {testutf
5de0: 70 72 65 76 20 74 65 73 74 62 79 74 65 73 74 72  prev testbytestr
5df0: 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75  ing} {.    testu
5e00: 74 66 70 72 65 76 20 41 5b 74 65 73 74 62 79 74  tfprev A[testbyt
5e10: 65 73 74 72 69 6e 67 20 5c 78 46 38 5c 78 41 30  estring \xF8\xA0
5e20: 5c 78 41 30 5c 78 46 38 5d 20 34 0a 7d 20 33 0a  \xA0\xF8] 4.} 3.
5e30: 74 65 73 74 20 75 74 66 2d 37 2e 31 35 2e 30 20  test utf-7.15.0 
5e40: 7b 54 63 6c 5f 55 74 66 50 72 65 76 7d 20 7b 74  {Tcl_UtfPrev} {t
5e50: 65 73 74 75 74 66 70 72 65 76 20 74 65 73 74 62  estutfprev testb
5e60: 79 74 65 73 74 72 69 6e 67 20 74 69 70 33 38 39  ytestring tip389
5e70: 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 70  } {.    testutfp
5e80: 72 65 76 20 41 5b 74 65 73 74 62 79 74 65 73 74  rev A[testbytest
5e90: 72 69 6e 67 20 5c 78 46 32 5c 78 41 30 5c 78 41  ring \xF2\xA0\xA
5ea0: 30 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d  0].} 1.test utf-
5eb0: 37 2e 31 35 2e 31 20 7b 54 63 6c 5f 55 74 66 50  7.15.1 {Tcl_UtfP
5ec0: 72 65 76 7d 20 7b 74 65 73 74 75 74 66 70 72 65  rev} {testutfpre
5ed0: 76 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  v testbytestring
5ee0: 20 75 63 73 34 7d 20 7b 0a 20 20 20 20 74 65 73   ucs4} {.    tes
5ef0: 74 75 74 66 70 72 65 76 20 41 5b 74 65 73 74 62  tutfprev A[testb
5f00: 79 74 65 73 74 72 69 6e 67 20 5c 78 46 32 5c 78  ytestring \xF2\x
5f10: 41 30 5c 78 41 30 5d 0a 7d 20 31 0a 74 65 73 74  A0\xA0].} 1.test
5f20: 20 75 74 66 2d 37 2e 31 35 2e 32 20 7b 54 63 6c   utf-7.15.2 {Tcl
5f30: 5f 55 74 66 50 72 65 76 7d 20 7b 74 65 73 74 75  _UtfPrev} {testu
5f40: 74 66 70 72 65 76 20 74 65 73 74 62 79 74 65 73  tfprev testbytes
5f50: 74 72 69 6e 67 20 74 69 70 33 38 39 7d 20 7b 0a  tring tip389} {.
5f60: 20 20 20 20 74 65 73 74 75 74 66 70 72 65 76 20      testutfprev 
5f70: 41 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  A[testbytestring
5f80: 20 5c 78 46 32 5c 78 41 30 5c 78 41 30 5c 78 41   \xF2\xA0\xA0\xA
5f90: 30 5d 20 34 0a 7d 20 31 0a 74 65 73 74 20 75 74  0] 4.} 1.test ut
5fa0: 66 2d 37 2e 31 35 2e 33 20 7b 54 63 6c 5f 55 74  f-7.15.3 {Tcl_Ut
5fb0: 66 50 72 65 76 7d 20 7b 74 65 73 74 75 74 66 70  fPrev} {testutfp
5fc0: 72 65 76 20 74 65 73 74 62 79 74 65 73 74 72 69  rev testbytestri
5fd0: 6e 67 20 75 63 73 34 7d 20 7b 0a 20 20 20 20 74  ng ucs4} {.    t
5fe0: 65 73 74 75 74 66 70 72 65 76 20 41 5b 74 65 73  estutfprev A[tes
5ff0: 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46 32  tbytestring \xF2
6000: 5c 78 41 30 5c 78 41 30 5c 78 41 30 5d 20 34 0a  \xA0\xA0\xA0] 4.
6010: 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 37 2e 31  } 1.test utf-7.1
6020: 35 2e 34 20 7b 54 63 6c 5f 55 74 66 50 72 65 76  5.4 {Tcl_UtfPrev
6030: 7d 20 7b 74 65 73 74 75 74 66 70 72 65 76 20 74  } {testutfprev t
6040: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 74 69  estbytestring ti
6050: 70 33 38 39 7d 20 7b 0a 20 20 20 20 74 65 73 74  p389} {.    test
6060: 75 74 66 70 72 65 76 20 41 5b 74 65 73 74 62 79  utfprev A[testby
6070: 74 65 73 74 72 69 6e 67 20 5c 78 46 32 5c 78 41  testring \xF2\xA
6080: 30 5c 78 41 30 5c 78 46 38 5d 20 34 0a 7d 20 31  0\xA0\xF8] 4.} 1
6090: 0a 74 65 73 74 20 75 74 66 2d 37 2e 31 35 2e 35  .test utf-7.15.5
60a0: 20 7b 54 63 6c 5f 55 74 66 50 72 65 76 7d 20 7b   {Tcl_UtfPrev} {
60b0: 74 65 73 74 75 74 66 70 72 65 76 20 74 65 73 74  testutfprev test
60c0: 62 79 74 65 73 74 72 69 6e 67 20 75 63 73 34 7d  bytestring ucs4}
60d0: 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 70 72   {.    testutfpr
60e0: 65 76 20 41 5b 74 65 73 74 62 79 74 65 73 74 72  ev A[testbytestr
60f0: 69 6e 67 20 5c 78 46 32 5c 78 41 30 5c 78 41 30  ing \xF2\xA0\xA0
6100: 5c 78 46 38 5d 20 34 0a 7d 20 31 0a 74 65 73 74  \xF8] 4.} 1.test
6110: 20 75 74 66 2d 37 2e 31 36 20 7b 54 63 6c 5f 55   utf-7.16 {Tcl_U
6120: 74 66 50 72 65 76 7d 20 74 65 73 74 75 74 66 70  tfPrev} testutfp
6130: 72 65 76 20 7b 0a 20 20 20 20 74 65 73 74 75 74  rev {.    testut
6140: 66 70 72 65 76 20 41 5c 75 38 38 32 30 0a 7d 20  fprev A\u8820.} 
6150: 31 0a 74 65 73 74 20 75 74 66 2d 37 2e 31 36 2e  1.test utf-7.16.
6160: 31 20 7b 54 63 6c 5f 55 74 66 50 72 65 76 7d 20  1 {Tcl_UtfPrev} 
6170: 7b 74 65 73 74 75 74 66 70 72 65 76 20 74 65 73  {testutfprev tes
6180: 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20  tbytestring} {. 
6190: 20 20 20 74 65 73 74 75 74 66 70 72 65 76 20 41     testutfprev A
61a0: 5c 75 38 38 32 30 5b 74 65 73 74 62 79 74 65 73  \u8820[testbytes
61b0: 74 72 69 6e 67 20 5c 78 41 30 5d 20 34 0a 7d 20  tring \xA0] 4.} 
61c0: 31 0a 74 65 73 74 20 75 74 66 2d 37 2e 31 36 2e  1.test utf-7.16.
61d0: 32 20 7b 54 63 6c 5f 55 74 66 50 72 65 76 7d 20  2 {Tcl_UtfPrev} 
61e0: 7b 74 65 73 74 75 74 66 70 72 65 76 20 74 65 73  {testutfprev tes
61f0: 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20  tbytestring} {. 
6200: 20 20 20 74 65 73 74 75 74 66 70 72 65 76 20 41     testutfprev A
6210: 5c 75 38 38 32 30 5b 74 65 73 74 62 79 74 65 73  \u8820[testbytes
6220: 74 72 69 6e 67 20 5c 78 46 38 5d 20 34 0a 7d 20  tring \xF8] 4.} 
6230: 31 0a 74 65 73 74 20 75 74 66 2d 37 2e 31 37 20  1.test utf-7.17 
6240: 7b 54 63 6c 5f 55 74 66 50 72 65 76 7d 20 7b 74  {Tcl_UtfPrev} {t
6250: 65 73 74 75 74 66 70 72 65 76 20 74 65 73 74 62  estutfprev testb
6260: 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20  ytestring} {.   
6270: 20 74 65 73 74 75 74 66 70 72 65 76 20 41 5b 74   testutfprev A[t
6280: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
6290: 44 30 5c 78 41 30 5c 78 41 30 5d 0a 7d 20 33 0a  D0\xA0\xA0].} 3.
62a0: 74 65 73 74 20 75 74 66 2d 37 2e 31 37 2e 31 20  test utf-7.17.1 
62b0: 7b 54 63 6c 5f 55 74 66 50 72 65 76 7d 20 7b 74  {Tcl_UtfPrev} {t
62c0: 65 73 74 75 74 66 70 72 65 76 20 74 65 73 74 62  estutfprev testb
62d0: 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20  ytestring} {.   
62e0: 20 74 65 73 74 75 74 66 70 72 65 76 20 41 5b 74   testutfprev A[t
62f0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
6300: 44 30 5c 78 41 30 5c 78 41 30 5c 78 41 30 5d 20  D0\xA0\xA0\xA0] 
6310: 34 0a 7d 20 33 0a 74 65 73 74 20 75 74 66 2d 37  4.} 3.test utf-7
6320: 2e 31 37 2e 32 20 7b 54 63 6c 5f 55 74 66 50 72  .17.2 {Tcl_UtfPr
6330: 65 76 7d 20 7b 74 65 73 74 75 74 66 70 72 65 76  ev} {testutfprev
6340: 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d   testbytestring}
6350: 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 70 72   {.    testutfpr
6360: 65 76 20 41 5b 74 65 73 74 62 79 74 65 73 74 72  ev A[testbytestr
6370: 69 6e 67 20 5c 78 44 30 5c 78 41 30 5c 78 41 30  ing \xD0\xA0\xA0
6380: 5c 78 46 38 5d 20 34 0a 7d 20 33 0a 74 65 73 74  \xF8] 4.} 3.test
6390: 20 75 74 66 2d 37 2e 31 38 2e 30 20 7b 54 63 6c   utf-7.18.0 {Tcl
63a0: 5f 55 74 66 50 72 65 76 7d 20 7b 74 65 73 74 75  _UtfPrev} {testu
63b0: 74 66 70 72 65 76 20 74 65 73 74 62 79 74 65 73  tfprev testbytes
63c0: 74 72 69 6e 67 20 74 69 70 33 38 39 7d 20 7b 0a  tring tip389} {.
63d0: 20 20 20 20 74 65 73 74 75 74 66 70 72 65 76 20      testutfprev 
63e0: 41 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  A[testbytestring
63f0: 20 5c 78 41 30 5c 78 41 30 5c 78 41 30 5d 0a 7d   \xA0\xA0\xA0].}
6400: 20 33 0a 74 65 73 74 20 75 74 66 2d 37 2e 31 38   3.test utf-7.18
6410: 2e 31 20 7b 54 63 6c 5f 55 74 66 50 72 65 76 7d  .1 {Tcl_UtfPrev}
6420: 20 7b 74 65 73 74 75 74 66 70 72 65 76 20 74 65   {testutfprev te
6430: 73 74 62 79 74 65 73 74 72 69 6e 67 20 75 63 73  stbytestring ucs
6440: 34 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66  4} {.    testutf
6450: 70 72 65 76 20 41 5b 74 65 73 74 62 79 74 65 73  prev A[testbytes
6460: 74 72 69 6e 67 20 5c 78 41 30 5c 78 41 30 5c 78  tring \xA0\xA0\x
6470: 41 30 5d 0a 7d 20 33 0a 74 65 73 74 20 75 74 66  A0].} 3.test utf
6480: 2d 37 2e 31 38 2e 32 20 7b 54 63 6c 5f 55 74 66  -7.18.2 {Tcl_Utf
6490: 50 72 65 76 7d 20 7b 74 65 73 74 75 74 66 70 72  Prev} {testutfpr
64a0: 65 76 20 74 65 73 74 62 79 74 65 73 74 72 69 6e  ev testbytestrin
64b0: 67 20 74 69 70 33 38 39 7d 20 7b 0a 20 20 20 20  g tip389} {.    
64c0: 74 65 73 74 75 74 66 70 72 65 76 20 41 5b 74 65  testutfprev A[te
64d0: 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 41  stbytestring \xA
64e0: 30 5c 78 41 30 5c 78 41 30 5c 78 41 30 5d 20 34  0\xA0\xA0\xA0] 4
64f0: 0a 7d 20 33 0a 74 65 73 74 20 75 74 66 2d 37 2e  .} 3.test utf-7.
6500: 31 38 2e 33 20 7b 54 63 6c 5f 55 74 66 50 72 65  18.3 {Tcl_UtfPre
6510: 76 7d 20 7b 74 65 73 74 75 74 66 70 72 65 76 20  v} {testutfprev 
6520: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 75  testbytestring u
6530: 63 73 34 7d 20 7b 0a 20 20 20 20 74 65 73 74 75  cs4} {.    testu
6540: 74 66 70 72 65 76 20 41 5b 74 65 73 74 62 79 74  tfprev A[testbyt
6550: 65 73 74 72 69 6e 67 20 5c 78 41 30 5c 78 41 30  estring \xA0\xA0
6560: 5c 78 41 30 5c 78 41 30 5d 20 34 0a 7d 20 33 0a  \xA0\xA0] 4.} 3.
6570: 74 65 73 74 20 75 74 66 2d 37 2e 31 38 2e 34 20  test utf-7.18.4 
6580: 7b 54 63 6c 5f 55 74 66 50 72 65 76 7d 20 7b 74  {Tcl_UtfPrev} {t
6590: 65 73 74 75 74 66 70 72 65 76 20 74 65 73 74 62  estutfprev testb
65a0: 79 74 65 73 74 72 69 6e 67 20 74 69 70 33 38 39  ytestring tip389
65b0: 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 70  } {.    testutfp
65c0: 72 65 76 20 41 5b 74 65 73 74 62 79 74 65 73 74  rev A[testbytest
65d0: 72 69 6e 67 20 5c 78 41 30 5c 78 41 30 5c 78 41  ring \xA0\xA0\xA
65e0: 30 5c 78 46 38 5d 20 34 0a 7d 20 33 0a 74 65 73  0\xF8] 4.} 3.tes
65f0: 74 20 75 74 66 2d 37 2e 31 38 2e 35 20 7b 54 63  t utf-7.18.5 {Tc
6600: 6c 5f 55 74 66 50 72 65 76 7d 20 7b 74 65 73 74  l_UtfPrev} {test
6610: 75 74 66 70 72 65 76 20 74 65 73 74 62 79 74 65  utfprev testbyte
6620: 73 74 72 69 6e 67 20 75 63 73 34 7d 20 7b 0a 20  string ucs4} {. 
6630: 20 20 20 74 65 73 74 75 74 66 70 72 65 76 20 41     testutfprev A
6640: 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20  [testbytestring 
6650: 5c 78 41 30 5c 78 41 30 5c 78 41 30 5c 78 46 38  \xA0\xA0\xA0\xF8
6660: 5d 20 34 0a 7d 20 33 0a 74 65 73 74 20 75 74 66  ] 4.} 3.test utf
6670: 2d 37 2e 31 39 2e 30 20 7b 54 63 6c 5f 55 74 66  -7.19.0 {Tcl_Utf
6680: 50 72 65 76 7d 20 7b 74 65 73 74 75 74 66 70 72  Prev} {testutfpr
6690: 65 76 20 74 65 73 74 62 79 74 65 73 74 72 69 6e  ev testbytestrin
66a0: 67 20 74 69 70 33 38 39 7d 20 7b 0a 20 20 20 20  g tip389} {.    
66b0: 74 65 73 74 75 74 66 70 72 65 76 20 41 5b 74 65  testutfprev A[te
66c0: 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46  stbytestring \xF
66d0: 38 5c 78 41 30 5c 78 41 30 5c 78 41 30 5d 0a 7d  8\xA0\xA0\xA0].}
66e0: 20 34 0a 74 65 73 74 20 75 74 66 2d 37 2e 31 39   4.test utf-7.19
66f0: 2e 31 20 7b 54 63 6c 5f 55 74 66 50 72 65 76 7d  .1 {Tcl_UtfPrev}
6700: 20 7b 74 65 73 74 75 74 66 70 72 65 76 20 74 65   {testutfprev te
6710: 73 74 62 79 74 65 73 74 72 69 6e 67 20 75 63 73  stbytestring ucs
6720: 34 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66  4} {.    testutf
6730: 70 72 65 76 20 41 5b 74 65 73 74 62 79 74 65 73  prev A[testbytes
6740: 74 72 69 6e 67 20 5c 78 46 38 5c 78 41 30 5c 78  tring \xF8\xA0\x
6750: 41 30 5c 78 41 30 5d 0a 7d 20 34 0a 74 65 73 74  A0\xA0].} 4.test
6760: 20 75 74 66 2d 37 2e 32 30 2e 30 20 7b 54 63 6c   utf-7.20.0 {Tcl
6770: 5f 55 74 66 50 72 65 76 7d 20 7b 74 65 73 74 75  _UtfPrev} {testu
6780: 74 66 70 72 65 76 20 74 65 73 74 62 79 74 65 73  tfprev testbytes
6790: 74 72 69 6e 67 20 74 69 70 33 38 39 7d 20 7b 0a  tring tip389} {.
67a0: 20 20 20 20 74 65 73 74 75 74 66 70 72 65 76 20      testutfprev 
67b0: 41 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  A[testbytestring
67c0: 20 5c 78 46 32 5c 78 41 30 5c 78 41 30 5c 78 41   \xF2\xA0\xA0\xA
67d0: 30 5d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d  0].} 1.test utf-
67e0: 37 2e 32 30 2e 31 20 7b 54 63 6c 5f 55 74 66 50  7.20.1 {Tcl_UtfP
67f0: 72 65 76 7d 20 7b 74 65 73 74 75 74 66 70 72 65  rev} {testutfpre
6800: 76 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  v testbytestring
6810: 20 75 63 73 34 7d 20 7b 0a 20 20 20 20 74 65 73   ucs4} {.    tes
6820: 74 75 74 66 70 72 65 76 20 41 5b 74 65 73 74 62  tutfprev A[testb
6830: 79 74 65 73 74 72 69 6e 67 20 5c 78 46 32 5c 78  ytestring \xF2\x
6840: 41 30 5c 78 41 30 5c 78 41 30 5d 0a 7d 20 31 0a  A0\xA0\xA0].} 1.
6850: 74 65 73 74 20 75 74 66 2d 37 2e 32 31 2e 30 20  test utf-7.21.0 
6860: 7b 54 63 6c 5f 55 74 66 50 72 65 76 7d 20 7b 74  {Tcl_UtfPrev} {t
6870: 65 73 74 75 74 66 70 72 65 76 20 74 65 73 74 62  estutfprev testb
6880: 79 74 65 73 74 72 69 6e 67 20 74 69 70 33 38 39  ytestring tip389
6890: 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 70  } {.    testutfp
68a0: 72 65 76 20 41 5c 75 38 38 32 30 5b 74 65 73 74  rev A\u8820[test
68b0: 62 79 74 65 73 74 72 69 6e 67 20 5c 78 41 30 5d  bytestring \xA0]
68c0: 0a 7d 20 34 0a 74 65 73 74 20 75 74 66 2d 37 2e  .} 4.test utf-7.
68d0: 32 31 2e 31 20 7b 54 63 6c 5f 55 74 66 50 72 65  21.1 {Tcl_UtfPre
68e0: 76 7d 20 7b 74 65 73 74 75 74 66 70 72 65 76 20  v} {testutfprev 
68f0: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 75  testbytestring u
6900: 63 73 34 7d 20 7b 0a 20 20 20 20 74 65 73 74 75  cs4} {.    testu
6910: 74 66 70 72 65 76 20 41 5c 75 38 38 32 30 5b 74  tfprev A\u8820[t
6920: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
6930: 41 30 5d 0a 7d 20 34 0a 74 65 73 74 20 75 74 66  A0].} 4.test utf
6940: 2d 37 2e 32 32 2e 30 20 7b 54 63 6c 5f 55 74 66  -7.22.0 {Tcl_Utf
6950: 50 72 65 76 7d 20 7b 74 65 73 74 75 74 66 70 72  Prev} {testutfpr
6960: 65 76 20 74 65 73 74 62 79 74 65 73 74 72 69 6e  ev testbytestrin
6970: 67 20 74 69 70 33 38 39 7d 20 7b 0a 20 20 20 20  g tip389} {.    
6980: 74 65 73 74 75 74 66 70 72 65 76 20 41 5b 74 65  testutfprev A[te
6990: 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 44  stbytestring \xD
69a0: 30 5c 78 41 30 5c 78 41 30 5c 78 41 30 5d 0a 7d  0\xA0\xA0\xA0].}
69b0: 20 34 0a 74 65 73 74 20 75 74 66 2d 37 2e 32 32   4.test utf-7.22
69c0: 2e 31 20 7b 54 63 6c 5f 55 74 66 50 72 65 76 7d  .1 {Tcl_UtfPrev}
69d0: 20 7b 74 65 73 74 75 74 66 70 72 65 76 20 74 65   {testutfprev te
69e0: 73 74 62 79 74 65 73 74 72 69 6e 67 20 75 63 73  stbytestring ucs
69f0: 34 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66  4} {.    testutf
6a00: 70 72 65 76 20 41 5b 74 65 73 74 62 79 74 65 73  prev A[testbytes
6a10: 74 72 69 6e 67 20 5c 78 44 30 5c 78 41 30 5c 78  tring \xD0\xA0\x
6a20: 41 30 5c 78 41 30 5d 0a 7d 20 34 0a 74 65 73 74  A0\xA0].} 4.test
6a30: 20 75 74 66 2d 37 2e 32 33 2e 30 20 7b 54 63 6c   utf-7.23.0 {Tcl
6a40: 5f 55 74 66 50 72 65 76 7d 20 7b 74 65 73 74 75  _UtfPrev} {testu
6a50: 74 66 70 72 65 76 20 74 65 73 74 62 79 74 65 73  tfprev testbytes
6a60: 74 72 69 6e 67 20 74 69 70 33 38 39 7d 20 7b 0a  tring tip389} {.
6a70: 20 20 20 20 74 65 73 74 75 74 66 70 72 65 76 20      testutfprev 
6a80: 41 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  A[testbytestring
6a90: 20 5c 78 41 30 5c 78 41 30 5c 78 41 30 5c 78 41   \xA0\xA0\xA0\xA
6aa0: 30 5d 0a 7d 20 34 0a 74 65 73 74 20 75 74 66 2d  0].} 4.test utf-
6ab0: 37 2e 32 33 2e 31 20 7b 54 63 6c 5f 55 74 66 50  7.23.1 {Tcl_UtfP
6ac0: 72 65 76 7d 20 7b 74 65 73 74 75 74 66 70 72 65  rev} {testutfpre
6ad0: 76 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  v testbytestring
6ae0: 20 75 63 73 34 7d 20 7b 0a 20 20 20 20 74 65 73   ucs4} {.    tes
6af0: 74 75 74 66 70 72 65 76 20 41 5b 74 65 73 74 62  tutfprev A[testb
6b00: 79 74 65 73 74 72 69 6e 67 20 5c 78 41 30 5c 78  ytestring \xA0\x
6b10: 41 30 5c 78 41 30 5c 78 41 30 5d 0a 7d 20 34 0a  A0\xA0\xA0].} 4.
6b20: 74 65 73 74 20 75 74 66 2d 37 2e 32 34 20 7b 54  test utf-7.24 {T
6b30: 63 6c 5f 55 74 66 50 72 65 76 20 2d 2d 20 6f 76  cl_UtfPrev -- ov
6b40: 65 72 6c 6f 6e 67 20 73 65 71 75 65 6e 63 65 7d  erlong sequence}
6b50: 20 20 7b 74 65 73 74 75 74 66 70 72 65 76 20 74    {testutfprev t
6b60: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
6b70: 0a 20 20 20 20 74 65 73 74 75 74 66 70 72 65 76  .    testutfprev
6b80: 20 41 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e   A[testbytestrin
6b90: 67 20 5c 78 43 30 5c 78 38 31 5d 0a 7d 20 32 0a  g \xC0\x81].} 2.
6ba0: 74 65 73 74 20 75 74 66 2d 37 2e 32 35 20 7b 54  test utf-7.25 {T
6bb0: 63 6c 5f 55 74 66 50 72 65 76 20 2d 2d 20 6f 76  cl_UtfPrev -- ov
6bc0: 65 72 6c 6f 6e 67 20 73 65 71 75 65 6e 63 65 7d  erlong sequence}
6bd0: 20 20 7b 74 65 73 74 75 74 66 70 72 65 76 20 74    {testutfprev t
6be0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
6bf0: 0a 20 20 20 20 74 65 73 74 75 74 66 70 72 65 76  .    testutfprev
6c00: 20 41 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e   A[testbytestrin
6c10: 67 20 5c 78 43 30 5c 78 38 31 5d 20 32 0a 7d 20  g \xC0\x81] 2.} 
6c20: 31 0a 74 65 73 74 20 75 74 66 2d 37 2e 32 36 20  1.test utf-7.26 
6c30: 7b 54 63 6c 5f 55 74 66 50 72 65 76 20 2d 2d 20  {Tcl_UtfPrev -- 
6c40: 6f 76 65 72 6c 6f 6e 67 20 73 65 71 75 65 6e 63  overlong sequenc
6c50: 65 7d 20 20 7b 74 65 73 74 75 74 66 70 72 65 76  e}  {testutfprev
6c60: 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d   testbytestring}
6c70: 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 70 72   {.    testutfpr
6c80: 65 76 20 41 5b 74 65 73 74 62 79 74 65 73 74 72  ev A[testbytestr
6c90: 69 6e 67 20 5c 78 45 30 5c 78 38 30 5c 78 38 30  ing \xE0\x80\x80
6ca0: 5d 0a 7d 20 33 0a 74 65 73 74 20 75 74 66 2d 37  ].} 3.test utf-7
6cb0: 2e 32 37 20 7b 54 63 6c 5f 55 74 66 50 72 65 76  .27 {Tcl_UtfPrev
6cc0: 20 2d 2d 20 6f 76 65 72 6c 6f 6e 67 20 73 65 71   -- overlong seq
6cd0: 75 65 6e 63 65 7d 20 20 7b 74 65 73 74 75 74 66  uence}  {testutf
6ce0: 70 72 65 76 20 74 65 73 74 62 79 74 65 73 74 72  prev testbytestr
6cf0: 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75  ing} {.    testu
6d00: 74 66 70 72 65 76 20 41 5b 74 65 73 74 62 79 74  tfprev A[testbyt
6d10: 65 73 74 72 69 6e 67 20 5c 78 45 30 5c 78 38 30  estring \xE0\x80
6d20: 5d 0a 7d 20 32 0a 74 65 73 74 20 75 74 66 2d 37  ].} 2.test utf-7
6d30: 2e 32 37 2e 31 20 7b 54 63 6c 5f 55 74 66 50 72  .27.1 {Tcl_UtfPr
6d40: 65 76 20 2d 2d 20 6f 76 65 72 6c 6f 6e 67 20 73  ev -- overlong s
6d50: 65 71 75 65 6e 63 65 7d 20 20 7b 74 65 73 74 75  equence}  {testu
6d60: 74 66 70 72 65 76 20 74 65 73 74 62 79 74 65 73  tfprev testbytes
6d70: 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73  tring} {.    tes
6d80: 74 75 74 66 70 72 65 76 20 41 5b 74 65 73 74 62  tutfprev A[testb
6d90: 79 74 65 73 74 72 69 6e 67 20 5c 78 45 30 5c 78  ytestring \xE0\x
6da0: 38 30 5c 78 38 30 5d 20 33 0a 7d 20 32 0a 74 65  80\x80] 3.} 2.te
6db0: 73 74 20 75 74 66 2d 37 2e 32 38 20 7b 54 63 6c  st utf-7.28 {Tcl
6dc0: 5f 55 74 66 50 72 65 76 20 2d 2d 20 6f 76 65 72  _UtfPrev -- over
6dd0: 6c 6f 6e 67 20 73 65 71 75 65 6e 63 65 7d 20 20  long sequence}  
6de0: 7b 74 65 73 74 75 74 66 70 72 65 76 20 74 65 73  {testutfprev tes
6df0: 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20  tbytestring} {. 
6e00: 20 20 20 74 65 73 74 75 74 66 70 72 65 76 20 41     testutfprev A
6e10: 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20  [testbytestring 
6e20: 5c 78 45 30 5d 0a 7d 20 31 0a 74 65 73 74 20 75  \xE0].} 1.test u
6e30: 74 66 2d 37 2e 32 38 2e 31 20 7b 54 63 6c 5f 55  tf-7.28.1 {Tcl_U
6e40: 74 66 50 72 65 76 20 2d 2d 20 6f 76 65 72 6c 6f  tfPrev -- overlo
6e50: 6e 67 20 73 65 71 75 65 6e 63 65 7d 20 20 7b 74  ng sequence}  {t
6e60: 65 73 74 75 74 66 70 72 65 76 20 74 65 73 74 62  estutfprev testb
6e70: 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20  ytestring} {.   
6e80: 20 74 65 73 74 75 74 66 70 72 65 76 20 41 5b 74   testutfprev A[t
6e90: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
6ea0: 45 30 5c 78 38 30 5c 78 38 30 5d 20 32 0a 7d 20  E0\x80\x80] 2.} 
6eb0: 31 0a 74 65 73 74 20 75 74 66 2d 37 2e 32 39 2e  1.test utf-7.29.
6ec0: 30 20 7b 54 63 6c 5f 55 74 66 50 72 65 76 20 2d  0 {Tcl_UtfPrev -
6ed0: 2d 20 6f 76 65 72 6c 6f 6e 67 20 73 65 71 75 65  - overlong seque
6ee0: 6e 63 65 7d 20 20 7b 74 65 73 74 75 74 66 70 72  nce}  {testutfpr
6ef0: 65 76 20 74 65 73 74 62 79 74 65 73 74 72 69 6e  ev testbytestrin
6f00: 67 20 74 69 70 33 38 39 7d 20 7b 0a 20 20 20 20  g tip389} {.    
6f10: 74 65 73 74 75 74 66 70 72 65 76 20 41 5b 74 65  testutfprev A[te
6f20: 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46  stbytestring \xF
6f30: 30 5c 78 38 30 5c 78 38 30 5c 78 38 30 5d 0a 7d  0\x80\x80\x80].}
6f40: 20 34 0a 74 65 73 74 20 75 74 66 2d 37 2e 32 39   4.test utf-7.29
6f50: 2e 31 20 7b 54 63 6c 5f 55 74 66 50 72 65 76 20  .1 {Tcl_UtfPrev 
6f60: 2d 2d 20 6f 76 65 72 6c 6f 6e 67 20 73 65 71 75  -- overlong sequ
6f70: 65 6e 63 65 7d 20 20 7b 74 65 73 74 75 74 66 70  ence}  {testutfp
6f80: 72 65 76 20 74 65 73 74 62 79 74 65 73 74 72 69  rev testbytestri
6f90: 6e 67 20 75 63 73 34 7d 20 7b 0a 20 20 20 20 74  ng ucs4} {.    t
6fa0: 65 73 74 75 74 66 70 72 65 76 20 41 5b 74 65 73  estutfprev A[tes
6fb0: 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46 30  tbytestring \xF0
6fc0: 5c 78 38 30 5c 78 38 30 5c 78 38 30 5d 0a 7d 20  \x80\x80\x80].} 
6fd0: 34 0a 74 65 73 74 20 75 74 66 2d 37 2e 33 30 20  4.test utf-7.30 
6fe0: 7b 54 63 6c 5f 55 74 66 50 72 65 76 20 2d 2d 20  {Tcl_UtfPrev -- 
6ff0: 6f 76 65 72 6c 6f 6e 67 20 73 65 71 75 65 6e 63  overlong sequenc
7000: 65 7d 20 20 7b 74 65 73 74 75 74 66 70 72 65 76  e}  {testutfprev
7010: 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d   testbytestring}
7020: 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 70 72   {.    testutfpr
7030: 65 76 20 41 5b 74 65 73 74 62 79 74 65 73 74 72  ev A[testbytestr
7040: 69 6e 67 20 5c 78 46 30 5c 78 38 30 5c 78 38 30  ing \xF0\x80\x80
7050: 5c 78 38 30 5d 20 34 0a 7d 20 33 0a 74 65 73 74  \x80] 4.} 3.test
7060: 20 75 74 66 2d 37 2e 33 31 20 7b 54 63 6c 5f 55   utf-7.31 {Tcl_U
7070: 74 66 50 72 65 76 20 2d 2d 20 6f 76 65 72 6c 6f  tfPrev -- overlo
7080: 6e 67 20 73 65 71 75 65 6e 63 65 7d 20 20 7b 74  ng sequence}  {t
7090: 65 73 74 75 74 66 70 72 65 76 20 74 65 73 74 62  estutfprev testb
70a0: 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20  ytestring} {.   
70b0: 20 74 65 73 74 75 74 66 70 72 65 76 20 41 5b 74   testutfprev A[t
70c0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
70d0: 46 30 5c 78 38 30 5c 78 38 30 5c 78 38 30 5d 20  F0\x80\x80\x80] 
70e0: 33 0a 7d 20 32 0a 74 65 73 74 20 75 74 66 2d 37  3.} 2.test utf-7
70f0: 2e 33 32 20 7b 54 63 6c 5f 55 74 66 50 72 65 76  .32 {Tcl_UtfPrev
7100: 20 2d 2d 20 6f 76 65 72 6c 6f 6e 67 20 73 65 71   -- overlong seq
7110: 75 65 6e 63 65 7d 20 20 7b 74 65 73 74 75 74 66  uence}  {testutf
7120: 70 72 65 76 20 74 65 73 74 62 79 74 65 73 74 72  prev testbytestr
7130: 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75  ing} {.    testu
7140: 74 66 70 72 65 76 20 41 5b 74 65 73 74 62 79 74  tfprev A[testbyt
7150: 65 73 74 72 69 6e 67 20 5c 78 46 30 5c 78 38 30  estring \xF0\x80
7160: 5c 78 38 30 5c 78 38 30 5d 20 32 0a 7d 20 31 0a  \x80\x80] 2.} 1.
7170: 74 65 73 74 20 75 74 66 2d 37 2e 33 33 20 7b 54  test utf-7.33 {T
7180: 63 6c 5f 55 74 66 50 72 65 76 20 2d 2d 20 6f 76  cl_UtfPrev -- ov
7190: 65 72 6c 6f 6e 67 20 73 65 71 75 65 6e 63 65 7d  erlong sequence}
71a0: 20 20 7b 74 65 73 74 75 74 66 70 72 65 76 20 74    {testutfprev t
71b0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
71c0: 0a 20 20 20 20 74 65 73 74 75 74 66 70 72 65 76  .    testutfprev
71d0: 20 41 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e   A[testbytestrin
71e0: 67 20 5c 78 43 30 5c 78 38 30 5d 0a 7d 20 31 0a  g \xC0\x80].} 1.
71f0: 74 65 73 74 20 75 74 66 2d 37 2e 33 34 20 7b 54  test utf-7.34 {T
7200: 63 6c 5f 55 74 66 50 72 65 76 20 2d 2d 20 6f 76  cl_UtfPrev -- ov
7210: 65 72 6c 6f 6e 67 20 73 65 71 75 65 6e 63 65 7d  erlong sequence}
7220: 20 20 7b 74 65 73 74 75 74 66 70 72 65 76 20 74    {testutfprev t
7230: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
7240: 0a 20 20 20 20 74 65 73 74 75 74 66 70 72 65 76  .    testutfprev
7250: 20 41 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e   A[testbytestrin
7260: 67 20 5c 78 43 31 5c 78 38 30 5d 0a 7d 20 32 0a  g \xC1\x80].} 2.
7270: 74 65 73 74 20 75 74 66 2d 37 2e 33 35 20 7b 54  test utf-7.35 {T
7280: 63 6c 5f 55 74 66 50 72 65 76 20 2d 2d 20 6f 76  cl_UtfPrev -- ov
7290: 65 72 6c 6f 6e 67 20 73 65 71 75 65 6e 63 65 7d  erlong sequence}
72a0: 20 20 7b 74 65 73 74 75 74 66 70 72 65 76 20 74    {testutfprev t
72b0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
72c0: 0a 20 20 20 20 74 65 73 74 75 74 66 70 72 65 76  .    testutfprev
72d0: 20 41 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e   A[testbytestrin
72e0: 67 20 5c 78 43 32 5c 78 38 30 5d 0a 7d 20 31 0a  g \xC2\x80].} 1.
72f0: 74 65 73 74 20 75 74 66 2d 37 2e 33 36 20 7b 54  test utf-7.36 {T
7300: 63 6c 5f 55 74 66 50 72 65 76 20 2d 2d 20 6f 76  cl_UtfPrev -- ov
7310: 65 72 6c 6f 6e 67 20 73 65 71 75 65 6e 63 65 7d  erlong sequence}
7320: 20 20 7b 74 65 73 74 75 74 66 70 72 65 76 20 74    {testutfprev t
7330: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
7340: 0a 20 20 20 20 74 65 73 74 75 74 66 70 72 65 76  .    testutfprev
7350: 20 41 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e   A[testbytestrin
7360: 67 20 5c 78 45 30 5c 78 41 30 5c 78 38 30 5d 0a  g \xE0\xA0\x80].
7370: 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 37 2e 33  } 1.test utf-7.3
7380: 37 20 7b 54 63 6c 5f 55 74 66 50 72 65 76 20 2d  7 {Tcl_UtfPrev -
7390: 2d 20 6f 76 65 72 6c 6f 6e 67 20 73 65 71 75 65  - overlong seque
73a0: 6e 63 65 7d 20 20 7b 74 65 73 74 75 74 66 70 72  nce}  {testutfpr
73b0: 65 76 20 74 65 73 74 62 79 74 65 73 74 72 69 6e  ev testbytestrin
73c0: 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66  g} {.    testutf
73d0: 70 72 65 76 20 41 5b 74 65 73 74 62 79 74 65 73  prev A[testbytes
73e0: 74 72 69 6e 67 20 5c 78 45 30 5c 78 41 30 5c 78  tring \xE0\xA0\x
73f0: 38 30 5d 20 33 0a 7d 20 31 0a 74 65 73 74 20 75  80] 3.} 1.test u
7400: 74 66 2d 37 2e 33 38 20 7b 54 63 6c 5f 55 74 66  tf-7.38 {Tcl_Utf
7410: 50 72 65 76 20 2d 2d 20 6f 76 65 72 6c 6f 6e 67  Prev -- overlong
7420: 20 73 65 71 75 65 6e 63 65 7d 20 20 7b 74 65 73   sequence}  {tes
7430: 74 75 74 66 70 72 65 76 20 74 65 73 74 62 79 74  tutfprev testbyt
7440: 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74  estring} {.    t
7450: 65 73 74 75 74 66 70 72 65 76 20 41 5b 74 65 73  estutfprev A[tes
7460: 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 45 30  tbytestring \xE0
7470: 5c 78 41 30 5c 78 38 30 5d 20 32 0a 7d 20 31 0a  \xA0\x80] 2.} 1.
7480: 74 65 73 74 20 75 74 66 2d 37 2e 33 39 2e 30 20  test utf-7.39.0 
7490: 7b 54 63 6c 5f 55 74 66 50 72 65 76 20 2d 2d 20  {Tcl_UtfPrev -- 
74a0: 6f 76 65 72 6c 6f 6e 67 20 73 65 71 75 65 6e 63  overlong sequenc
74b0: 65 7d 20 20 7b 74 65 73 74 75 74 66 70 72 65 76  e}  {testutfprev
74c0: 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20   testbytestring 
74d0: 74 69 70 33 38 39 7d 20 7b 0a 20 20 20 20 74 65  tip389} {.    te
74e0: 73 74 75 74 66 70 72 65 76 20 41 5b 74 65 73 74  stutfprev A[test
74f0: 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46 30 5c  bytestring \xF0\
7500: 78 39 30 5c 78 38 30 5c 78 38 30 5d 0a 7d 20 31  x90\x80\x80].} 1
7510: 0a 74 65 73 74 20 75 74 66 2d 37 2e 33 39 2e 31  .test utf-7.39.1
7520: 20 7b 54 63 6c 5f 55 74 66 50 72 65 76 20 2d 2d   {Tcl_UtfPrev --
7530: 20 6f 76 65 72 6c 6f 6e 67 20 73 65 71 75 65 6e   overlong sequen
7540: 63 65 7d 20 20 7b 74 65 73 74 75 74 66 70 72 65  ce}  {testutfpre
7550: 76 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  v testbytestring
7560: 20 75 63 73 34 7d 20 7b 0a 20 20 20 20 74 65 73   ucs4} {.    tes
7570: 74 75 74 66 70 72 65 76 20 41 5b 74 65 73 74 62  tutfprev A[testb
7580: 79 74 65 73 74 72 69 6e 67 20 5c 78 46 30 5c 78  ytestring \xF0\x
7590: 39 30 5c 78 38 30 5c 78 38 30 5d 0a 7d 20 31 0a  90\x80\x80].} 1.
75a0: 74 65 73 74 20 75 74 66 2d 37 2e 34 30 2e 30 20  test utf-7.40.0 
75b0: 7b 54 63 6c 5f 55 74 66 50 72 65 76 20 2d 2d 20  {Tcl_UtfPrev -- 
75c0: 6f 76 65 72 6c 6f 6e 67 20 73 65 71 75 65 6e 63  overlong sequenc
75d0: 65 7d 20 20 7b 74 65 73 74 75 74 66 70 72 65 76  e}  {testutfprev
75e0: 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20   testbytestring 
75f0: 74 69 70 33 38 39 7d 20 7b 0a 20 20 20 20 74 65  tip389} {.    te
7600: 73 74 75 74 66 70 72 65 76 20 41 5b 74 65 73 74  stutfprev A[test
7610: 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46 30 5c  bytestring \xF0\
7620: 78 39 30 5c 78 38 30 5c 78 38 30 5d 20 34 0a 7d  x90\x80\x80] 4.}
7630: 20 31 0a 74 65 73 74 20 75 74 66 2d 37 2e 34 30   1.test utf-7.40
7640: 2e 31 20 7b 54 63 6c 5f 55 74 66 50 72 65 76 20  .1 {Tcl_UtfPrev 
7650: 2d 2d 20 6f 76 65 72 6c 6f 6e 67 20 73 65 71 75  -- overlong sequ
7660: 65 6e 63 65 7d 20 20 7b 74 65 73 74 75 74 66 70  ence}  {testutfp
7670: 72 65 76 20 74 65 73 74 62 79 74 65 73 74 72 69  rev testbytestri
7680: 6e 67 20 75 63 73 34 7d 20 7b 0a 20 20 20 20 74  ng ucs4} {.    t
7690: 65 73 74 75 74 66 70 72 65 76 20 41 5b 74 65 73  estutfprev A[tes
76a0: 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78 46 30  tbytestring \xF0
76b0: 5c 78 39 30 5c 78 38 30 5c 78 38 30 5d 20 34 0a  \x90\x80\x80] 4.
76c0: 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 37 2e 34  } 1.test utf-7.4
76d0: 31 2e 30 20 7b 54 63 6c 5f 55 74 66 50 72 65 76  1.0 {Tcl_UtfPrev
76e0: 20 2d 2d 20 6f 76 65 72 6c 6f 6e 67 20 73 65 71   -- overlong seq
76f0: 75 65 6e 63 65 7d 20 20 7b 74 65 73 74 75 74 66  uence}  {testutf
7700: 70 72 65 76 20 74 65 73 74 62 79 74 65 73 74 72  prev testbytestr
7710: 69 6e 67 20 74 69 70 33 38 39 7d 20 7b 0a 20 20  ing tip389} {.  
7720: 20 20 74 65 73 74 75 74 66 70 72 65 76 20 41 5b    testutfprev A[
7730: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c  testbytestring \
7740: 78 46 30 5c 78 39 30 5c 78 38 30 5c 78 38 30 5d  xF0\x90\x80\x80]
7750: 20 33 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d   3.} 1.test utf-
7760: 37 2e 34 31 2e 31 20 7b 54 63 6c 5f 55 74 66 50  7.41.1 {Tcl_UtfP
7770: 72 65 76 20 2d 2d 20 6f 76 65 72 6c 6f 6e 67 20  rev -- overlong 
7780: 73 65 71 75 65 6e 63 65 7d 20 20 7b 74 65 73 74  sequence}  {test
7790: 75 74 66 70 72 65 76 20 74 65 73 74 62 79 74 65  utfprev testbyte
77a0: 73 74 72 69 6e 67 20 75 63 73 34 7d 20 7b 0a 20  string ucs4} {. 
77b0: 20 20 20 74 65 73 74 75 74 66 70 72 65 76 20 41     testutfprev A
77c0: 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20  [testbytestring 
77d0: 5c 78 46 30 5c 78 39 30 5c 78 38 30 5c 78 38 30  \xF0\x90\x80\x80
77e0: 5d 20 33 0a 7d 20 31 0a 74 65 73 74 20 75 74 66  ] 3.} 1.test utf
77f0: 2d 37 2e 34 32 20 7b 54 63 6c 5f 55 74 66 50 72  -7.42 {Tcl_UtfPr
7800: 65 76 20 2d 2d 20 6f 76 65 72 6c 6f 6e 67 20 73  ev -- overlong s
7810: 65 71 75 65 6e 63 65 7d 20 20 7b 74 65 73 74 75  equence}  {testu
7820: 74 66 70 72 65 76 20 74 65 73 74 62 79 74 65 73  tfprev testbytes
7830: 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73  tring} {.    tes
7840: 74 75 74 66 70 72 65 76 20 41 5b 74 65 73 74 62  tutfprev A[testb
7850: 79 74 65 73 74 72 69 6e 67 20 5c 78 46 30 5c 78  ytestring \xF0\x
7860: 39 30 5c 78 38 30 5c 78 38 30 5d 20 32 0a 7d 20  90\x80\x80] 2.} 
7870: 31 0a 74 65 73 74 20 75 74 66 2d 37 2e 34 33 20  1.test utf-7.43 
7880: 7b 54 63 6c 5f 55 74 66 50 72 65 76 20 2d 2d 20  {Tcl_UtfPrev -- 
7890: 6e 6f 20 6c 65 61 64 20 62 79 74 65 20 61 74 20  no lead byte at 
78a0: 73 74 61 72 74 7d 20 20 7b 74 65 73 74 75 74 66  start}  {testutf
78b0: 70 72 65 76 20 74 65 73 74 62 79 74 65 73 74 72  prev testbytestr
78c0: 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75  ing} {.    testu
78d0: 74 66 70 72 65 76 20 5b 74 65 73 74 62 79 74 65  tfprev [testbyte
78e0: 73 74 72 69 6e 67 20 5c 78 41 30 5d 0a 7d 20 30  string \xA0].} 0
78f0: 0a 74 65 73 74 20 75 74 66 2d 37 2e 34 34 20 7b  .test utf-7.44 {
7900: 54 63 6c 5f 55 74 66 50 72 65 76 20 2d 2d 20 6e  Tcl_UtfPrev -- n
7910: 6f 20 6c 65 61 64 20 62 79 74 65 20 61 74 20 73  o lead byte at s
7920: 74 61 72 74 7d 20 20 7b 74 65 73 74 75 74 66 70  tart}  {testutfp
7930: 72 65 76 20 74 65 73 74 62 79 74 65 73 74 72 69  rev testbytestri
7940: 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74  ng} {.    testut
7950: 66 70 72 65 76 20 5b 74 65 73 74 62 79 74 65 73  fprev [testbytes
7960: 74 72 69 6e 67 20 5c 78 41 30 5c 78 41 30 5d 0a  tring \xA0\xA0].
7970: 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 37 2e 34  } 1.test utf-7.4
7980: 35 20 7b 54 63 6c 5f 55 74 66 50 72 65 76 20 2d  5 {Tcl_UtfPrev -
7990: 2d 20 6e 6f 20 6c 65 61 64 20 62 79 74 65 20 61  - no lead byte a
79a0: 74 20 73 74 61 72 74 7d 20 20 7b 74 65 73 74 75  t start}  {testu
79b0: 74 66 70 72 65 76 20 74 65 73 74 62 79 74 65 73  tfprev testbytes
79c0: 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73  tring} {.    tes
79d0: 74 75 74 66 70 72 65 76 20 5b 74 65 73 74 62 79  tutfprev [testby
79e0: 74 65 73 74 72 69 6e 67 20 5c 78 41 30 5c 78 41  testring \xA0\xA
79f0: 30 5c 78 41 30 5d 0a 7d 20 32 0a 74 65 73 74 20  0\xA0].} 2.test 
7a00: 75 74 66 2d 37 2e 34 36 2e 30 20 7b 54 63 6c 5f  utf-7.46.0 {Tcl_
7a10: 55 74 66 50 72 65 76 20 2d 2d 20 6e 6f 20 6c 65  UtfPrev -- no le
7a20: 61 64 20 62 79 74 65 20 61 74 20 73 74 61 72 74  ad byte at start
7a30: 7d 20 20 7b 74 65 73 74 75 74 66 70 72 65 76 20  }  {testutfprev 
7a40: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 74  testbytestring t
7a50: 69 70 33 38 39 7d 20 7b 0a 20 20 20 20 74 65 73  ip389} {.    tes
7a60: 74 75 74 66 70 72 65 76 20 5b 74 65 73 74 62 79  tutfprev [testby
7a70: 74 65 73 74 72 69 6e 67 20 5c 78 41 30 5c 78 41  testring \xA0\xA
7a80: 30 5c 78 41 30 5c 78 41 30 5d 0a 7d 20 33 0a 74  0\xA0\xA0].} 3.t
7a90: 65 73 74 20 75 74 66 2d 37 2e 34 36 2e 31 20 7b  est utf-7.46.1 {
7aa0: 54 63 6c 5f 55 74 66 50 72 65 76 20 2d 2d 20 6e  Tcl_UtfPrev -- n
7ab0: 6f 20 6c 65 61 64 20 62 79 74 65 20 61 74 20 73  o lead byte at s
7ac0: 74 61 72 74 7d 20 20 7b 74 65 73 74 75 74 66 70  tart}  {testutfp
7ad0: 72 65 76 20 74 65 73 74 62 79 74 65 73 74 72 69  rev testbytestri
7ae0: 6e 67 20 75 63 73 34 7d 20 7b 0a 20 20 20 20 74  ng ucs4} {.    t
7af0: 65 73 74 75 74 66 70 72 65 76 20 5b 74 65 73 74  estutfprev [test
7b00: 62 79 74 65 73 74 72 69 6e 67 20 5c 78 41 30 5c  bytestring \xA0\
7b10: 78 41 30 5c 78 41 30 5c 78 41 30 5d 0a 7d 20 33  xA0\xA0\xA0].} 3
7b20: 0a 74 65 73 74 20 75 74 66 2d 37 2e 34 37 20 7b  .test utf-7.47 {
7b30: 54 63 6c 5f 55 74 66 50 72 65 76 2c 20 70 6f 69  Tcl_UtfPrev, poi
7b40: 6e 74 69 6e 67 20 74 6f 20 33 74 68 20 62 79 74  nting to 3th byt
7b50: 65 20 6f 66 20 33 2d 62 79 74 65 20 76 61 6c 69  e of 3-byte vali
7b60: 64 20 73 65 71 75 65 6e 63 65 7d 20 7b 74 65 73  d sequence} {tes
7b70: 74 75 74 66 70 72 65 76 20 74 65 73 74 62 79 74  tutfprev testbyt
7b80: 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20 20 74  estring} {.    t
7b90: 65 73 74 75 74 66 70 72 65 76 20 5b 74 65 73 74  estutfprev [test
7ba0: 62 79 74 65 73 74 72 69 6e 67 20 5c 78 45 38 5c  bytestring \xE8\
7bb0: 78 41 30 5d 0a 7d 20 30 0a 74 65 73 74 20 75 74  xA0].} 0.test ut
7bc0: 66 2d 37 2e 34 37 2e 31 20 7b 54 63 6c 5f 55 74  f-7.47.1 {Tcl_Ut
7bd0: 66 50 72 65 76 2c 20 70 6f 69 6e 74 69 6e 67 20  fPrev, pointing 
7be0: 74 6f 20 33 74 68 20 62 79 74 65 20 6f 66 20 33  to 3th byte of 3
7bf0: 2d 62 79 74 65 20 76 61 6c 69 64 20 73 65 71 75  -byte valid sequ
7c00: 65 6e 63 65 7d 20 7b 74 65 73 74 75 74 66 70 72  ence} {testutfpr
7c10: 65 76 20 74 65 73 74 62 79 74 65 73 74 72 69 6e  ev testbytestrin
7c20: 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66  g} {.    testutf
7c30: 70 72 65 76 20 5c 75 38 38 32 30 20 32 0a 7d 20  prev \u8820 2.} 
7c40: 30 0a 74 65 73 74 20 75 74 66 2d 37 2e 34 37 2e  0.test utf-7.47.
7c50: 32 20 7b 54 63 6c 5f 55 74 66 50 72 65 76 2c 20  2 {Tcl_UtfPrev, 
7c60: 70 6f 69 6e 74 69 6e 67 20 74 6f 20 33 74 68 20  pointing to 3th 
7c70: 62 79 74 65 20 6f 66 20 33 2d 62 79 74 65 20 69  byte of 3-byte i
7c80: 6e 76 61 6c 69 64 20 73 65 71 75 65 6e 63 65 7d  nvalid sequence}
7c90: 20 7b 74 65 73 74 75 74 66 70 72 65 76 20 74 65   {testutfprev te
7ca0: 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a  stbytestring} {.
7cb0: 20 20 20 20 74 65 73 74 75 74 66 70 72 65 76 20      testutfprev 
7cc0: 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20  [testbytestring 
7cd0: 5c 78 45 38 5c 78 41 30 5c 78 30 30 5d 20 32 0a  \xE8\xA0\x00] 2.
7ce0: 7d 20 30 0a 74 65 73 74 20 75 74 66 2d 37 2e 34  } 0.test utf-7.4
7cf0: 38 2e 30 20 7b 54 63 6c 5f 55 74 66 50 72 65 76  8.0 {Tcl_UtfPrev
7d00: 2c 20 76 61 6c 69 64 69 74 79 20 63 68 65 63 6b  , validity check
7d10: 20 5b 34 39 33 64 63 63 63 32 64 65 5d 7d 20 7b   [493dccc2de]} {
7d20: 74 65 73 74 75 74 66 70 72 65 76 20 74 65 73 74  testutfprev test
7d30: 62 79 74 65 73 74 72 69 6e 67 20 74 69 70 33 38  bytestring tip38
7d40: 39 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66  9} {.    testutf
7d50: 70 72 65 76 20 41 5c 75 44 42 46 46 5c 75 44 46  prev A\uDBFF\uDF
7d60: 46 46 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d  FF.} 1.test utf-
7d70: 37 2e 34 38 2e 31 20 7b 54 63 6c 5f 55 74 66 50  7.48.1 {Tcl_UtfP
7d80: 72 65 76 2c 20 76 61 6c 69 64 69 74 79 20 63 68  rev, validity ch
7d90: 65 63 6b 20 5b 34 39 33 64 63 63 63 32 64 65 5d  eck [493dccc2de]
7da0: 7d 20 7b 74 65 73 74 75 74 66 70 72 65 76 20 74  } {testutfprev t
7db0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 75 63  estbytestring uc
7dc0: 73 34 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74  s4} {.    testut
7dd0: 66 70 72 65 76 20 41 5c 55 31 30 46 46 46 46 0a  fprev A\U10FFFF.
7de0: 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 37 2e 34  } 1.test utf-7.4
7df0: 38 2e 32 20 7b 54 63 6c 5f 55 74 66 50 72 65 76  8.2 {Tcl_UtfPrev
7e00: 2c 20 76 61 6c 69 64 69 74 79 20 63 68 65 63 6b  , validity check
7e10: 20 5b 34 39 33 64 63 63 63 32 64 65 5d 7d 20 7b   [493dccc2de]} {
7e20: 74 65 73 74 75 74 66 70 72 65 76 20 74 65 73 74  testutfprev test
7e30: 62 79 74 65 73 74 72 69 6e 67 20 74 69 70 33 38  bytestring tip38
7e40: 39 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66  9} {.    testutf
7e50: 70 72 65 76 20 41 5c 75 44 42 46 46 5c 75 44 46  prev A\uDBFF\uDF
7e60: 46 46 20 34 0a 7d 20 31 0a 74 65 73 74 20 75 74  FF 4.} 1.test ut
7e70: 66 2d 37 2e 34 38 2e 33 20 7b 54 63 6c 5f 55 74  f-7.48.3 {Tcl_Ut
7e80: 66 50 72 65 76 2c 20 76 61 6c 69 64 69 74 79 20  fPrev, validity 
7e90: 63 68 65 63 6b 20 5b 34 39 33 64 63 63 63 32 64  check [493dccc2d
7ea0: 65 5d 7d 20 7b 74 65 73 74 75 74 66 70 72 65 76  e]} {testutfprev
7eb0: 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20   testbytestring 
7ec0: 75 63 73 34 7d 20 7b 0a 20 20 20 20 74 65 73 74  ucs4} {.    test
7ed0: 75 74 66 70 72 65 76 20 41 5c 55 31 30 46 46 46  utfprev A\U10FFF
7ee0: 46 20 34 0a 7d 20 31 0a 74 65 73 74 20 75 74 66  F 4.} 1.test utf
7ef0: 2d 37 2e 34 38 2e 34 20 7b 54 63 6c 5f 55 74 66  -7.48.4 {Tcl_Utf
7f00: 50 72 65 76 2c 20 76 61 6c 69 64 69 74 79 20 63  Prev, validity c
7f10: 68 65 63 6b 20 5b 34 39 33 64 63 63 63 32 64 65  heck [493dccc2de
7f20: 5d 7d 20 7b 74 65 73 74 75 74 66 70 72 65 76 20  ]} {testutfprev 
7f30: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 74  testbytestring t
7f40: 69 70 33 38 39 7d 20 7b 0a 20 20 20 20 74 65 73  ip389} {.    tes
7f50: 74 75 74 66 70 72 65 76 20 41 5c 75 44 42 46 46  tutfprev A\uDBFF
7f60: 5c 75 44 46 46 46 20 33 0a 7d 20 31 0a 74 65 73  \uDFFF 3.} 1.tes
7f70: 74 20 75 74 66 2d 37 2e 34 38 2e 35 20 7b 54 63  t utf-7.48.5 {Tc
7f80: 6c 5f 55 74 66 50 72 65 76 2c 20 76 61 6c 69 64  l_UtfPrev, valid
7f90: 69 74 79 20 63 68 65 63 6b 20 5b 34 39 33 64 63  ity check [493dc
7fa0: 63 63 32 64 65 5d 7d 20 7b 74 65 73 74 75 74 66  cc2de]} {testutf
7fb0: 70 72 65 76 20 74 65 73 74 62 79 74 65 73 74 72  prev testbytestr
7fc0: 69 6e 67 20 75 63 73 34 7d 20 7b 0a 20 20 20 20  ing ucs4} {.    
7fd0: 74 65 73 74 75 74 66 70 72 65 76 20 41 5c 55 31  testutfprev A\U1
7fe0: 30 46 46 46 46 20 33 0a 7d 20 31 0a 74 65 73 74  0FFFF 3.} 1.test
7ff0: 20 75 74 66 2d 37 2e 34 38 2e 36 20 7b 54 63 6c   utf-7.48.6 {Tcl
8000: 5f 55 74 66 50 72 65 76 2c 20 76 61 6c 69 64 69  _UtfPrev, validi
8010: 74 79 20 63 68 65 63 6b 20 5b 34 39 33 64 63 63  ty check [493dcc
8020: 63 32 64 65 5d 7d 20 7b 74 65 73 74 75 74 66 70  c2de]} {testutfp
8030: 72 65 76 20 74 65 73 74 62 79 74 65 73 74 72 69  rev testbytestri
8040: 6e 67 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74  ng} {.    testut
8050: 66 70 72 65 76 20 41 5c 55 31 30 46 46 46 46 20  fprev A\U10FFFF 
8060: 32 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 37  2.} 1.test utf-7
8070: 2e 34 39 2e 30 20 7b 54 63 6c 5f 55 74 66 50 72  .49.0 {Tcl_UtfPr
8080: 65 76 2c 20 76 61 6c 69 64 69 74 79 20 63 68 65  ev, validity che
8090: 63 6b 20 5b 34 39 33 64 63 63 63 32 64 65 5d 7d  ck [493dccc2de]}
80a0: 20 7b 74 65 73 74 75 74 66 70 72 65 76 20 74 65   {testutfprev te
80b0: 73 74 62 79 74 65 73 74 72 69 6e 67 20 74 69 70  stbytestring tip
80c0: 33 38 39 7d 20 7b 0a 20 20 20 20 74 65 73 74 75  389} {.    testu
80d0: 74 66 70 72 65 76 20 41 5b 74 65 73 74 62 79 74  tfprev A[testbyt
80e0: 65 73 74 72 69 6e 67 20 5c 78 46 34 5c 78 39 30  estring \xF4\x90
80f0: 5c 78 38 30 5c 78 38 30 5d 0a 7d 20 34 0a 74 65  \x80\x80].} 4.te
8100: 73 74 20 75 74 66 2d 37 2e 34 39 2e 31 20 7b 54  st utf-7.49.1 {T
8110: 63 6c 5f 55 74 66 50 72 65 76 2c 20 76 61 6c 69  cl_UtfPrev, vali
8120: 64 69 74 79 20 63 68 65 63 6b 20 5b 34 39 33 64  dity check [493d
8130: 63 63 63 32 64 65 5d 7d 20 7b 74 65 73 74 75 74  ccc2de]} {testut
8140: 66 70 72 65 76 20 74 65 73 74 62 79 74 65 73 74  fprev testbytest
8150: 72 69 6e 67 20 75 63 73 34 7d 20 7b 0a 20 20 20  ring ucs4} {.   
8160: 20 74 65 73 74 75 74 66 70 72 65 76 20 41 5b 74   testutfprev A[t
8170: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
8180: 46 34 5c 78 39 30 5c 78 38 30 5c 78 38 30 5d 0a  F4\x90\x80\x80].
8190: 7d 20 34 0a 74 65 73 74 20 75 74 66 2d 37 2e 34  } 4.test utf-7.4
81a0: 39 2e 32 20 7b 54 63 6c 5f 55 74 66 50 72 65 76  9.2 {Tcl_UtfPrev
81b0: 2c 20 76 61 6c 69 64 69 74 79 20 63 68 65 63 6b  , validity check
81c0: 20 5b 34 39 33 64 63 63 63 32 64 65 5d 7d 20 7b   [493dccc2de]} {
81d0: 74 65 73 74 75 74 66 70 72 65 76 20 74 65 73 74  testutfprev test
81e0: 62 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20  bytestring} {.  
81f0: 20 20 74 65 73 74 75 74 66 70 72 65 76 20 41 5b    testutfprev A[
8200: 74 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c  testbytestring \
8210: 78 46 34 5c 78 39 30 5c 78 38 30 5c 78 38 30 5d  xF4\x90\x80\x80]
8220: 20 34 0a 7d 20 33 0a 74 65 73 74 20 75 74 66 2d   4.} 3.test utf-
8230: 37 2e 34 39 2e 33 20 7b 54 63 6c 5f 55 74 66 50  7.49.3 {Tcl_UtfP
8240: 72 65 76 2c 20 76 61 6c 69 64 69 74 79 20 63 68  rev, validity ch
8250: 65 63 6b 20 5b 34 39 33 64 63 63 63 32 64 65 5d  eck [493dccc2de]
8260: 7d 20 7b 74 65 73 74 75 74 66 70 72 65 76 20 74  } {testutfprev t
8270: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
8280: 0a 20 20 20 20 74 65 73 74 75 74 66 70 72 65 76  .    testutfprev
8290: 20 41 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e   A[testbytestrin
82a0: 67 20 5c 78 46 34 5c 78 39 30 5c 78 38 30 5c 78  g \xF4\x90\x80\x
82b0: 38 30 5d 20 33 0a 7d 20 32 0a 74 65 73 74 20 75  80] 3.} 2.test u
82c0: 74 66 2d 37 2e 34 39 2e 34 20 7b 54 63 6c 5f 55  tf-7.49.4 {Tcl_U
82d0: 74 66 50 72 65 76 2c 20 76 61 6c 69 64 69 74 79  tfPrev, validity
82e0: 20 63 68 65 63 6b 20 5b 34 39 33 64 63 63 63 32   check [493dccc2
82f0: 64 65 5d 7d 20 7b 74 65 73 74 75 74 66 70 72 65  de]} {testutfpre
8300: 76 20 74 65 73 74 62 79 74 65 73 74 72 69 6e 67  v testbytestring
8310: 7d 20 7b 0a 20 20 20 20 74 65 73 74 75 74 66 70  } {.    testutfp
8320: 72 65 76 20 41 5b 74 65 73 74 62 79 74 65 73 74  rev A[testbytest
8330: 72 69 6e 67 20 5c 78 46 34 5c 78 39 30 5c 78 38  ring \xF4\x90\x8
8340: 30 5c 78 38 30 5d 20 32 0a 7d 20 31 0a 0a 74 65  0\x80] 2.} 1..te
8350: 73 74 20 75 74 66 2d 38 2e 31 20 7b 54 63 6c 5f  st utf-8.1 {Tcl_
8360: 55 6e 69 43 68 61 72 41 74 49 6e 64 65 78 3a 20  UniCharAtIndex: 
8370: 69 6e 64 65 78 20 3d 20 30 7d 20 7b 0a 20 20 20  index = 0} {.   
8380: 20 73 74 72 69 6e 67 20 69 6e 64 65 78 20 61 62   string index ab
8390: 63 64 20 30 0a 7d 20 61 0a 74 65 73 74 20 75 74  cd 0.} a.test ut
83a0: 66 2d 38 2e 32 20 7b 54 63 6c 5f 55 6e 69 43 68  f-8.2 {Tcl_UniCh
83b0: 61 72 41 74 49 6e 64 65 78 3a 20 69 6e 64 65 78  arAtIndex: index
83c0: 20 3d 20 30 7d 20 7b 0a 20 20 20 20 73 74 72 69   = 0} {.    stri
83d0: 6e 67 20 69 6e 64 65 78 20 5c 75 34 45 34 45 5c  ng index \u4E4E\
83e0: 75 32 35 41 20 30 0a 7d 20 22 5c 75 34 45 34 45  u25A 0.} "\u4E4E
83f0: 22 0a 74 65 73 74 20 75 74 66 2d 38 2e 33 20 7b  ".test utf-8.3 {
8400: 54 63 6c 5f 55 6e 69 43 68 61 72 41 74 49 6e 64  Tcl_UniCharAtInd
8410: 65 78 3a 20 69 6e 64 65 78 20 3e 20 30 7d 20 7b  ex: index > 0} {
8420: 0a 20 20 20 20 73 74 72 69 6e 67 20 69 6e 64 65  .    string inde
8430: 78 20 61 62 63 64 20 32 0a 7d 20 63 0a 74 65 73  x abcd 2.} c.tes
8440: 74 20 75 74 66 2d 38 2e 34 20 7b 54 63 6c 5f 55  t utf-8.4 {Tcl_U
8450: 6e 69 43 68 61 72 41 74 49 6e 64 65 78 3a 20 69  niCharAtIndex: i
8460: 6e 64 65 78 20 3e 20 30 7d 20 7b 0a 20 20 20 20  ndex > 0} {.    
8470: 73 74 72 69 6e 67 20 69 6e 64 65 78 20 5c 75 34  string index \u4
8480: 45 34 45 5c 75 32 35 41 5c 78 46 46 5c 75 35 34  E4E\u25A\xFF\u54
8490: 33 20 32 0a 7d 20 22 5c 75 46 46 22 0a 74 65 73  3 2.} "\uFF".tes
84a0: 74 20 75 74 66 2d 38 2e 35 2e 30 20 7b 54 63 6c  t utf-8.5.0 {Tcl
84b0: 5f 55 6e 69 43 68 61 72 41 74 49 6e 64 65 78 3a  _UniCharAtIndex:
84c0: 20 68 69 67 68 20 73 75 72 72 6f 67 61 74 65 7d   high surrogate}
84d0: 20 75 63 73 32 20 7b 0a 20 20 20 20 73 74 72 69   ucs2 {.    stri
84e0: 6e 67 20 69 6e 64 65 78 20 5c 75 44 38 34 32 20  ng index \uD842 
84f0: 30 0a 7d 20 22 5c 75 44 38 34 32 22 0a 74 65 73  0.} "\uD842".tes
8500: 74 20 75 74 66 2d 38 2e 35 2e 31 20 7b 54 63 6c  t utf-8.5.1 {Tcl
8510: 5f 55 6e 69 43 68 61 72 41 74 49 6e 64 65 78 3a  _UniCharAtIndex:
8520: 20 68 69 67 68 20 73 75 72 72 6f 67 61 74 65 7d   high surrogate}
8530: 20 75 63 73 34 20 7b 0a 20 20 20 20 73 74 72 69   ucs4 {.    stri
8540: 6e 67 20 69 6e 64 65 78 20 5c 75 44 38 34 32 20  ng index \uD842 
8550: 30 0a 7d 20 22 5c 75 44 38 34 32 22 0a 74 65 73  0.} "\uD842".tes
8560: 74 20 75 74 66 2d 38 2e 35 2e 32 20 7b 54 63 6c  t utf-8.5.2 {Tcl
8570: 5f 55 6e 69 43 68 61 72 41 74 49 6e 64 65 78 3a  _UniCharAtIndex:
8580: 20 68 69 67 68 20 73 75 72 72 6f 67 61 74 65 7d   high surrogate}
8590: 20 74 69 70 33 38 39 20 7b 0a 20 20 20 20 73 74   tip389 {.    st
85a0: 72 69 6e 67 20 69 6e 64 65 78 20 5c 75 44 38 34  ring index \uD84
85b0: 32 20 30 0a 7d 20 22 5c 75 44 38 34 32 22 0a 74  2 0.} "\uD842".t
85c0: 65 73 74 20 75 74 66 2d 38 2e 36 20 7b 54 63 6c  est utf-8.6 {Tcl
85d0: 5f 55 6e 69 43 68 61 72 41 74 49 6e 64 65 78 3a  _UniCharAtIndex:
85e0: 20 6c 6f 77 20 73 75 72 72 6f 67 61 74 65 7d 20   low surrogate} 
85f0: 7b 0a 20 20 20 20 73 74 72 69 6e 67 20 69 6e 64  {.    string ind
8600: 65 78 20 5c 75 44 43 34 32 20 30 0a 7d 20 22 5c  ex \uDC42 0.} "\
8610: 75 44 43 34 32 22 0a 74 65 73 74 20 75 74 66 2d  uDC42".test utf-
8620: 38 2e 37 2e 30 20 7b 54 63 6c 5f 55 6e 69 43 68  8.7.0 {Tcl_UniCh
8630: 61 72 41 74 49 6e 64 65 78 3a 20 45 6d 6f 6a 69  arAtIndex: Emoji
8640: 7d 20 75 63 73 32 20 7b 0a 20 20 20 20 73 74 72  } ucs2 {.    str
8650: 69 6e 67 20 69 6e 64 65 78 20 5c 75 44 38 33 44  ing index \uD83D
8660: 5c 75 44 45 30 30 47 20 30 0a 7d 20 22 5c 75 44  \uDE00G 0.} "\uD
8670: 38 33 44 22 0a 74 65 73 74 20 75 74 66 2d 38 2e  83D".test utf-8.
8680: 37 2e 31 20 7b 54 63 6c 5f 55 6e 69 43 68 61 72  7.1 {Tcl_UniChar
8690: 41 74 49 6e 64 65 78 3a 20 45 6d 6f 6a 69 7d 20  AtIndex: Emoji} 
86a0: 75 63 73 34 20 7b 0a 20 20 20 20 73 74 72 69 6e  ucs4 {.    strin
86b0: 67 20 69 6e 64 65 78 20 5c 75 44 38 33 44 5c 75  g index \uD83D\u
86c0: 44 45 30 30 47 20 30 0a 7d 20 22 5c 55 31 46 36  DE00G 0.} "\U1F6
86d0: 30 30 22 0a 74 65 73 74 20 75 74 66 2d 38 2e 37  00".test utf-8.7
86e0: 2e 32 20 7b 54 63 6c 5f 55 6e 69 43 68 61 72 41  .2 {Tcl_UniCharA
86f0: 74 49 6e 64 65 78 3a 20 45 6d 6f 6a 69 7d 20 74  tIndex: Emoji} t
8700: 69 70 33 38 39 20 7b 0a 20 20 20 20 73 74 72 69  ip389 {.    stri
8710: 6e 67 20 69 6e 64 65 78 20 5c 75 44 38 33 44 5c  ng index \uD83D\
8720: 75 44 45 30 30 47 20 30 0a 7d 20 22 5c 55 31 46  uDE00G 0.} "\U1F
8730: 36 30 30 22 0a 74 65 73 74 20 75 74 66 2d 38 2e  600".test utf-8.
8740: 38 2e 30 20 7b 54 63 6c 5f 55 6e 69 43 68 61 72  8.0 {Tcl_UniChar
8750: 41 74 49 6e 64 65 78 3a 20 45 6d 6f 6a 69 7d 20  AtIndex: Emoji} 
8760: 75 63 73 32 20 7b 0a 20 20 20 20 73 74 72 69 6e  ucs2 {.    strin
8770: 67 20 69 6e 64 65 78 20 5c 75 44 38 33 44 5c 75  g index \uD83D\u
8780: 44 45 30 30 47 20 31 0a 7d 20 22 5c 75 44 45 30  DE00G 1.} "\uDE0
8790: 30 22 0a 74 65 73 74 20 75 74 66 2d 38 2e 38 2e  0".test utf-8.8.
87a0: 31 20 7b 54 63 6c 5f 55 6e 69 43 68 61 72 41 74  1 {Tcl_UniCharAt
87b0: 49 6e 64 65 78 3a 20 45 6d 6f 6a 69 7d 20 75 63  Index: Emoji} uc
87c0: 73 34 20 7b 0a 20 20 20 20 73 74 72 69 6e 67 20  s4 {.    string 
87d0: 69 6e 64 65 78 20 5c 75 44 38 33 44 5c 75 44 45  index \uD83D\uDE
87e0: 30 30 47 20 31 0a 7d 20 47 0a 74 65 73 74 20 75  00G 1.} G.test u
87f0: 74 66 2d 38 2e 38 2e 32 20 7b 54 63 6c 5f 55 6e  tf-8.8.2 {Tcl_Un
8800: 69 43 68 61 72 41 74 49 6e 64 65 78 3a 20 45 6d  iCharAtIndex: Em
8810: 6f 6a 69 7d 20 74 69 70 33 38 39 20 7b 0a 20 20  oji} tip389 {.  
8820: 20 20 73 74 72 69 6e 67 20 69 6e 64 65 78 20 5c    string index \
8830: 75 44 38 33 44 5c 75 44 45 30 30 47 20 31 0a 7d  uD83D\uDE00G 1.}
8840: 20 7b 7d 0a 74 65 73 74 20 75 74 66 2d 38 2e 39   {}.test utf-8.9
8850: 2e 30 20 7b 54 63 6c 5f 55 6e 69 43 68 61 72 41  .0 {Tcl_UniCharA
8860: 74 49 6e 64 65 78 3a 20 45 6d 6f 6a 69 7d 20 75  tIndex: Emoji} u
8870: 63 73 32 20 7b 0a 20 20 20 20 73 74 72 69 6e 67  cs2 {.    string
8880: 20 69 6e 64 65 78 20 5c 75 44 38 33 44 5c 75 44   index \uD83D\uD
8890: 45 30 30 47 20 32 0a 7d 20 47 0a 74 65 73 74 20  E00G 2.} G.test 
88a0: 75 74 66 2d 38 2e 39 2e 31 20 7b 54 63 6c 5f 55  utf-8.9.1 {Tcl_U
88b0: 6e 69 43 68 61 72 41 74 49 6e 64 65 78 3a 20 45  niCharAtIndex: E
88c0: 6d 6f 6a 69 7d 20 75 63 73 34 20 7b 0a 20 20 20  moji} ucs4 {.   
88d0: 20 73 74 72 69 6e 67 20 69 6e 64 65 78 20 5c 75   string index \u
88e0: 44 38 33 44 5c 75 44 45 30 30 47 20 32 0a 7d 20  D83D\uDE00G 2.} 
88f0: 7b 7d 0a 74 65 73 74 20 75 74 66 2d 38 2e 39 2e  {}.test utf-8.9.
8900: 32 20 7b 54 63 6c 5f 55 6e 69 43 68 61 72 41 74  2 {Tcl_UniCharAt
8910: 49 6e 64 65 78 3a 20 45 6d 6f 6a 69 7d 20 74 69  Index: Emoji} ti
8920: 70 33 38 39 20 7b 0a 20 20 20 20 73 74 72 69 6e  p389 {.    strin
8930: 67 20 69 6e 64 65 78 20 5c 75 44 38 33 44 5c 75  g index \uD83D\u
8940: 44 45 30 30 47 20 32 0a 7d 20 47 0a 74 65 73 74  DE00G 2.} G.test
8950: 20 75 74 66 2d 38 2e 31 30 2e 30 20 7b 54 63 6c   utf-8.10.0 {Tcl
8960: 5f 55 6e 69 43 68 61 72 41 74 49 6e 64 65 78 3a  _UniCharAtIndex:
8970: 20 45 6d 6f 6a 69 7d 20 7b 55 65 73 63 20 75 63   Emoji} {Uesc uc
8980: 73 32 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e 67  s2} {.    string
8990: 20 69 6e 64 65 78 20 5c 55 31 46 36 30 30 47 20   index \U1F600G 
89a0: 30 0a 7d 20 22 5c 75 46 46 46 44 22 0a 74 65 73  0.} "\uFFFD".tes
89b0: 74 20 75 74 66 2d 38 2e 31 30 2e 31 20 7b 54 63  t utf-8.10.1 {Tc
89c0: 6c 5f 55 6e 69 43 68 61 72 41 74 49 6e 64 65 78  l_UniCharAtIndex
89d0: 3a 20 45 6d 6f 6a 69 7d 20 7b 55 65 73 63 20 75  : Emoji} {Uesc u
89e0: 63 73 34 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e  cs4} {.    strin
89f0: 67 20 69 6e 64 65 78 20 5c 55 31 46 36 30 30 47  g index \U1F600G
8a00: 20 30 0a 7d 20 22 5c 55 31 46 36 30 30 22 0a 74   0.} "\U1F600".t
8a10: 65 73 74 20 75 74 66 2d 38 2e 31 30 2e 32 20 7b  est utf-8.10.2 {
8a20: 54 63 6c 5f 55 6e 69 43 68 61 72 41 74 49 6e 64  Tcl_UniCharAtInd
8a30: 65 78 3a 20 45 6d 6f 6a 69 7d 20 7b 55 65 73 63  ex: Emoji} {Uesc
8a40: 20 74 69 70 33 38 39 7d 20 7b 0a 20 20 20 20 73   tip389} {.    s
8a50: 74 72 69 6e 67 20 69 6e 64 65 78 20 5c 55 31 46  tring index \U1F
8a60: 36 30 30 47 20 30 0a 7d 20 22 5c 55 31 46 36 30  600G 0.} "\U1F60
8a70: 30 22 0a 74 65 73 74 20 75 74 66 2d 38 2e 31 31  0".test utf-8.11
8a80: 2e 30 20 7b 54 63 6c 5f 55 6e 69 43 68 61 72 41  .0 {Tcl_UniCharA
8a90: 74 49 6e 64 65 78 3a 20 45 6d 6f 6a 69 7d 20 7b  tIndex: Emoji} {
8aa0: 55 65 73 63 20 75 63 73 32 7d 20 7b 0a 20 20 20  Uesc ucs2} {.   
8ab0: 20 73 74 72 69 6e 67 20 69 6e 64 65 78 20 5c 55   string index \U
8ac0: 31 46 36 30 30 47 20 31 0a 7d 20 47 0a 74 65 73  1F600G 1.} G.tes
8ad0: 74 20 75 74 66 2d 38 2e 31 31 2e 31 20 7b 54 63  t utf-8.11.1 {Tc
8ae0: 6c 5f 55 6e 69 43 68 61 72 41 74 49 6e 64 65 78  l_UniCharAtIndex
8af0: 3a 20 45 6d 6f 6a 69 7d 20 7b 55 65 73 63 20 75  : Emoji} {Uesc u
8b00: 63 73 34 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e  cs4} {.    strin
8b10: 67 20 69 6e 64 65 78 20 5c 55 31 46 36 30 30 47  g index \U1F600G
8b20: 20 31 0a 7d 20 47 0a 74 65 73 74 20 75 74 66 2d   1.} G.test utf-
8b30: 38 2e 31 31 2e 32 20 7b 54 63 6c 5f 55 6e 69 43  8.11.2 {Tcl_UniC
8b40: 68 61 72 41 74 49 6e 64 65 78 3a 20 45 6d 6f 6a  harAtIndex: Emoj
8b50: 69 7d 20 7b 55 65 73 63 20 74 69 70 33 38 39 7d  i} {Uesc tip389}
8b60: 20 7b 0a 20 20 20 20 73 74 72 69 6e 67 20 69 6e   {.    string in
8b70: 64 65 78 20 5c 55 31 46 36 30 30 47 20 31 0a 7d  dex \U1F600G 1.}
8b80: 20 7b 7d 0a 74 65 73 74 20 75 74 66 2d 38 2e 31   {}.test utf-8.1
8b90: 32 2e 30 20 7b 54 63 6c 5f 55 6e 69 43 68 61 72  2.0 {Tcl_UniChar
8ba0: 41 74 49 6e 64 65 78 3a 20 45 6d 6f 6a 69 7d 20  AtIndex: Emoji} 
8bb0: 7b 55 65 73 63 20 75 63 73 32 7d 20 7b 0a 20 20  {Uesc ucs2} {.  
8bc0: 20 20 73 74 72 69 6e 67 20 69 6e 64 65 78 20 5c    string index \
8bd0: 55 31 46 36 30 30 47 20 32 0a 7d 20 7b 7d 0a 74  U1F600G 2.} {}.t
8be0: 65 73 74 20 75 74 66 2d 38 2e 31 32 2e 31 20 7b  est utf-8.12.1 {
8bf0: 54 63 6c 5f 55 6e 69 43 68 61 72 41 74 49 6e 64  Tcl_UniCharAtInd
8c00: 65 78 3a 20 45 6d 6f 6a 69 7d 20 7b 55 65 73 63  ex: Emoji} {Uesc
8c10: 20 75 63 73 34 7d 20 7b 0a 20 20 20 20 73 74 72   ucs4} {.    str
8c20: 69 6e 67 20 69 6e 64 65 78 20 5c 55 31 46 36 30  ing index \U1F60
8c30: 30 47 20 32 0a 7d 20 7b 7d 0a 74 65 73 74 20 75  0G 2.} {}.test u
8c40: 74 66 2d 38 2e 31 32 2e 32 20 7b 54 63 6c 5f 55  tf-8.12.2 {Tcl_U
8c50: 6e 69 43 68 61 72 41 74 49 6e 64 65 78 3a 20 45  niCharAtIndex: E
8c60: 6d 6f 6a 69 7d 20 7b 55 65 73 63 20 74 69 70 33  moji} {Uesc tip3
8c70: 38 39 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e 67  89} {.    string
8c80: 20 69 6e 64 65 78 20 5c 55 31 46 36 30 30 47 20   index \U1F600G 
8c90: 32 0a 7d 20 47 0a 0a 74 65 73 74 20 75 74 66 2d  2.} G..test utf-
8ca0: 39 2e 31 20 7b 54 63 6c 5f 55 74 66 41 74 49 6e  9.1 {Tcl_UtfAtIn
8cb0: 64 65 78 3a 20 69 6e 64 65 78 20 3d 20 30 7d 20  dex: index = 0} 
8cc0: 7b 0a 20 20 20 20 73 74 72 69 6e 67 20 72 61 6e  {.    string ran
8cd0: 67 65 20 61 62 63 64 20 30 20 32 0a 7d 20 61 62  ge abcd 0 2.} ab
8ce0: 63 0a 74 65 73 74 20 75 74 66 2d 39 2e 32 20 7b  c.test utf-9.2 {
8cf0: 54 63 6c 5f 55 74 66 41 74 49 6e 64 65 78 3a 20  Tcl_UtfAtIndex: 
8d00: 69 6e 64 65 78 20 3e 20 30 7d 20 7b 0a 20 20 20  index > 0} {.   
8d10: 20 73 74 72 69 6e 67 20 72 61 6e 67 65 20 5c 75   string range \u
8d20: 34 45 34 45 5c 75 32 35 41 5c 78 46 46 5c 75 35  4E4E\u25A\xFF\u5
8d30: 34 33 6b 6c 6d 6e 6f 70 20 31 20 35 0a 7d 20 22  43klmnop 1 5.} "
8d40: 5c 75 32 35 41 5c 78 46 46 5c 75 35 34 33 6b 6c  \u25A\xFF\u543kl
8d50: 22 0a 74 65 73 74 20 75 74 66 2d 39 2e 33 2e 30  ".test utf-9.3.0
8d60: 20 7b 54 63 6c 5f 55 74 66 41 74 49 6e 64 65 78   {Tcl_UtfAtIndex
8d70: 3a 20 69 6e 64 65 78 20 3d 20 30 2c 20 45 6d 6f  : index = 0, Emo
8d80: 6a 69 7d 20 75 63 73 32 20 7b 0a 20 20 20 20 73  ji} ucs2 {.    s
8d90: 74 72 69 6e 67 20 72 61 6e 67 65 20 5c 75 44 38  tring range \uD8
8da0: 33 44 5c 75 44 45 30 30 47 20 30 20 30 0a 7d 20  3D\uDE00G 0 0.} 
8db0: 22 5c 75 44 38 33 44 22 0a 74 65 73 74 20 75 74  "\uD83D".test ut
8dc0: 66 2d 39 2e 33 2e 31 20 7b 54 63 6c 5f 55 74 66  f-9.3.1 {Tcl_Utf
8dd0: 41 74 49 6e 64 65 78 3a 20 69 6e 64 65 78 20 3d  AtIndex: index =
8de0: 20 30 2c 20 45 6d 6f 6a 69 7d 20 75 63 73 34 20   0, Emoji} ucs4 
8df0: 7b 0a 20 20 20 20 73 74 72 69 6e 67 20 72 61 6e  {.    string ran
8e00: 67 65 20 5c 75 44 38 33 44 5c 75 44 45 30 30 47  ge \uD83D\uDE00G
8e10: 20 30 20 30 0a 7d 20 22 5c 55 31 46 36 30 30 22   0 0.} "\U1F600"
8e20: 0a 74 65 73 74 20 75 74 66 2d 39 2e 33 2e 32 20  .test utf-9.3.2 
8e30: 7b 54 63 6c 5f 55 74 66 41 74 49 6e 64 65 78 3a  {Tcl_UtfAtIndex:
8e40: 20 69 6e 64 65 78 20 3d 20 30 2c 20 45 6d 6f 6a   index = 0, Emoj
8e50: 69 7d 20 74 69 70 33 38 39 20 7b 0a 20 20 20 20  i} tip389 {.    
8e60: 73 74 72 69 6e 67 20 72 61 6e 67 65 20 5c 75 44  string range \uD
8e70: 38 33 44 5c 75 44 45 30 30 47 20 30 20 30 0a 7d  83D\uDE00G 0 0.}
8e80: 20 22 5c 55 31 46 36 30 30 22 0a 74 65 73 74 20   "\U1F600".test 
8e90: 75 74 66 2d 39 2e 34 2e 30 20 7b 54 63 6c 5f 55  utf-9.4.0 {Tcl_U
8ea0: 74 66 41 74 49 6e 64 65 78 3a 20 69 6e 64 65 78  tfAtIndex: index
8eb0: 20 3e 20 30 2c 20 45 6d 6f 6a 69 7d 20 75 63 73   > 0, Emoji} ucs
8ec0: 32 20 7b 0a 20 20 20 20 73 74 72 69 6e 67 20 72  2 {.    string r
8ed0: 61 6e 67 65 20 5c 75 44 38 33 44 5c 75 44 45 30  ange \uD83D\uDE0
8ee0: 30 47 20 31 20 31 0a 7d 20 22 5c 75 44 45 30 30  0G 1 1.} "\uDE00
8ef0: 22 0a 74 65 73 74 20 75 74 66 2d 39 2e 34 2e 31  ".test utf-9.4.1
8f00: 20 7b 54 63 6c 5f 55 74 66 41 74 49 6e 64 65 78   {Tcl_UtfAtIndex
8f10: 3a 20 69 6e 64 65 78 20 3e 20 30 2c 20 45 6d 6f  : index > 0, Emo
8f20: 6a 69 7d 20 75 63 73 34 20 7b 0a 20 20 20 20 73  ji} ucs4 {.    s
8f30: 74 72 69 6e 67 20 72 61 6e 67 65 20 5c 75 44 38  tring range \uD8
8f40: 33 44 5c 75 44 45 30 30 47 20 31 20 31 0a 7d 20  3D\uDE00G 1 1.} 
8f50: 22 47 22 0a 74 65 73 74 20 75 74 66 2d 39 2e 34  "G".test utf-9.4
8f60: 2e 32 20 7b 54 63 6c 5f 55 74 66 41 74 49 6e 64  .2 {Tcl_UtfAtInd
8f70: 65 78 3a 20 69 6e 64 65 78 20 3e 20 30 2c 20 45  ex: index > 0, E
8f80: 6d 6f 6a 69 7d 20 74 69 70 33 38 39 20 7b 0a 20  moji} tip389 {. 
8f90: 20 20 20 73 74 72 69 6e 67 20 72 61 6e 67 65 20     string range 
8fa0: 5c 75 44 38 33 44 5c 75 44 45 30 30 47 20 31 20  \uD83D\uDE00G 1 
8fb0: 31 0a 7d 20 7b 7d 0a 74 65 73 74 20 75 74 66 2d  1.} {}.test utf-
8fc0: 39 2e 35 2e 30 20 7b 54 63 6c 5f 55 74 66 41 74  9.5.0 {Tcl_UtfAt
8fd0: 49 6e 64 65 78 3a 20 69 6e 64 65 78 20 3e 20 30  Index: index > 0
8fe0: 2c 20 45 6d 6f 6a 69 7d 20 75 63 73 32 20 7b 0a  , Emoji} ucs2 {.
8ff0: 20 20 20 20 73 74 72 69 6e 67 20 72 61 6e 67 65      string range
9000: 20 5c 75 44 38 33 44 5c 75 44 45 30 30 47 20 32   \uD83D\uDE00G 2
9010: 20 32 0a 7d 20 47 0a 74 65 73 74 20 75 74 66 2d   2.} G.test utf-
9020: 39 2e 35 2e 31 20 7b 54 63 6c 5f 55 74 66 41 74  9.5.1 {Tcl_UtfAt
9030: 49 6e 64 65 78 3a 20 69 6e 64 65 78 20 3e 20 30  Index: index > 0
9040: 2c 20 45 6d 6f 6a 69 7d 20 75 63 73 34 20 7b 0a  , Emoji} ucs4 {.
9050: 20 20 20 20 73 74 72 69 6e 67 20 72 61 6e 67 65      string range
9060: 20 5c 75 44 38 33 44 5c 75 44 45 30 30 47 20 32   \uD83D\uDE00G 2
9070: 20 32 0a 7d 20 7b 7d 0a 74 65 73 74 20 75 74 66   2.} {}.test utf
9080: 2d 39 2e 35 2e 32 20 7b 54 63 6c 5f 55 74 66 41  -9.5.2 {Tcl_UtfA
9090: 74 49 6e 64 65 78 3a 20 69 6e 64 65 78 20 3e 20  tIndex: index > 
90a0: 30 2c 20 45 6d 6f 6a 69 7d 20 74 69 70 33 38 39  0, Emoji} tip389
90b0: 20 7b 0a 20 20 20 20 73 74 72 69 6e 67 20 72 61   {.    string ra
90c0: 6e 67 65 20 5c 75 44 38 33 44 5c 75 44 45 30 30  nge \uD83D\uDE00
90d0: 47 20 32 20 32 0a 7d 20 47 0a 74 65 73 74 20 75  G 2 2.} G.test u
90e0: 74 66 2d 39 2e 36 2e 30 20 7b 54 63 6c 5f 55 74  tf-9.6.0 {Tcl_Ut
90f0: 66 41 74 49 6e 64 65 78 3a 20 69 6e 64 65 78 20  fAtIndex: index 
9100: 3d 20 30 2c 20 45 6d 6f 6a 69 7d 20 7b 55 65 73  = 0, Emoji} {Ues
9110: 63 20 75 63 73 32 7d 20 7b 0a 20 20 20 20 73 74  c ucs2} {.    st
9120: 72 69 6e 67 20 72 61 6e 67 65 20 5c 55 31 66 36  ring range \U1f6
9130: 30 30 47 20 30 20 30 0a 7d 20 22 5c 75 46 46 46  00G 0 0.} "\uFFF
9140: 44 22 0a 74 65 73 74 20 75 74 66 2d 39 2e 36 2e  D".test utf-9.6.
9150: 31 20 7b 54 63 6c 5f 55 74 66 41 74 49 6e 64 65  1 {Tcl_UtfAtInde
9160: 78 3a 20 69 6e 64 65 78 20 3d 20 30 2c 20 45 6d  x: index = 0, Em
9170: 6f 6a 69 7d 20 7b 55 65 73 63 20 75 63 73 34 7d  oji} {Uesc ucs4}
9180: 20 7b 0a 20 20 20 20 73 74 72 69 6e 67 20 72 61   {.    string ra
9190: 6e 67 65 20 5c 55 31 66 36 30 30 47 20 30 20 30  nge \U1f600G 0 0
91a0: 0a 7d 20 22 5c 55 31 46 36 30 30 22 0a 74 65 73  .} "\U1F600".tes
91b0: 74 20 75 74 66 2d 39 2e 36 2e 32 20 7b 54 63 6c  t utf-9.6.2 {Tcl
91c0: 5f 55 74 66 41 74 49 6e 64 65 78 3a 20 69 6e 64  _UtfAtIndex: ind
91d0: 65 78 20 3d 20 30 2c 20 45 6d 6f 6a 69 7d 20 7b  ex = 0, Emoji} {
91e0: 55 65 73 63 20 74 69 70 33 38 39 7d 20 7b 0a 20  Uesc tip389} {. 
91f0: 20 20 20 73 74 72 69 6e 67 20 72 61 6e 67 65 20     string range 
9200: 5c 55 31 66 36 30 30 47 20 30 20 30 0a 7d 20 22  \U1f600G 0 0.} "
9210: 5c 55 31 46 36 30 30 22 0a 74 65 73 74 20 75 74  \U1F600".test ut
9220: 66 2d 39 2e 37 2e 30 20 7b 54 63 6c 5f 55 74 66  f-9.7.0 {Tcl_Utf
9230: 41 74 49 6e 64 65 78 3a 20 69 6e 64 65 78 20 3e  AtIndex: index >
9240: 20 30 2c 20 45 6d 6f 6a 69 7d 20 7b 55 65 73 63   0, Emoji} {Uesc
9250: 20 75 63 73 32 7d 20 7b 0a 20 20 20 20 73 74 72   ucs2} {.    str
9260: 69 6e 67 20 72 61 6e 67 65 20 5c 55 31 66 36 30  ing range \U1f60
9270: 30 47 20 31 20 31 0a 7d 20 47 0a 74 65 73 74 20  0G 1 1.} G.test 
9280: 75 74 66 2d 39 2e 37 2e 31 20 7b 54 63 6c 5f 55  utf-9.7.1 {Tcl_U
9290: 74 66 41 74 49 6e 64 65 78 3a 20 69 6e 64 65 78  tfAtIndex: index
92a0: 20 3e 20 30 2c 20 45 6d 6f 6a 69 7d 20 7b 55 65   > 0, Emoji} {Ue
92b0: 73 63 20 75 63 73 34 7d 20 7b 0a 20 20 20 20 73  sc ucs4} {.    s
92c0: 74 72 69 6e 67 20 72 61 6e 67 65 20 5c 55 31 66  tring range \U1f
92d0: 36 30 30 47 20 31 20 31 0a 7d 20 22 47 22 0a 74  600G 1 1.} "G".t
92e0: 65 73 74 20 75 74 66 2d 39 2e 37 2e 32 20 7b 54  est utf-9.7.2 {T
92f0: 63 6c 5f 55 74 66 41 74 49 6e 64 65 78 3a 20 69  cl_UtfAtIndex: i
9300: 6e 64 65 78 20 3e 20 30 2c 20 45 6d 6f 6a 69 7d  ndex > 0, Emoji}
9310: 20 7b 55 65 73 63 20 74 69 70 33 38 39 7d 20 7b   {Uesc tip389} {
9320: 0a 20 20 20 20 73 74 72 69 6e 67 20 72 61 6e 67  .    string rang
9330: 65 20 5c 55 31 66 36 30 30 47 20 31 20 31 0a 7d  e \U1f600G 1 1.}
9340: 20 7b 7d 0a 74 65 73 74 20 75 74 66 2d 39 2e 38   {}.test utf-9.8
9350: 2e 30 20 7b 54 63 6c 5f 55 74 66 41 74 49 6e 64  .0 {Tcl_UtfAtInd
9360: 65 78 3a 20 69 6e 64 65 78 20 3e 20 30 2c 20 45  ex: index > 0, E
9370: 6d 6f 6a 69 7d 20 7b 55 65 73 63 20 75 63 73 32  moji} {Uesc ucs2
9380: 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e 67 20 72  } {.    string r
9390: 61 6e 67 65 20 5c 55 31 66 36 30 30 47 20 32 20  ange \U1f600G 2 
93a0: 32 0a 7d 20 7b 7d 0a 74 65 73 74 20 75 74 66 2d  2.} {}.test utf-
93b0: 39 2e 38 2e 31 20 7b 54 63 6c 5f 55 74 66 41 74  9.8.1 {Tcl_UtfAt
93c0: 49 6e 64 65 78 3a 20 69 6e 64 65 78 20 3e 20 30  Index: index > 0
93d0: 2c 20 45 6d 6f 6a 69 7d 20 7b 55 65 73 63 20 75  , Emoji} {Uesc u
93e0: 63 73 34 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e  cs4} {.    strin
93f0: 67 20 72 61 6e 67 65 20 5c 55 31 66 36 30 30 47  g range \U1f600G
9400: 20 32 20 32 0a 7d 20 7b 7d 0a 74 65 73 74 20 75   2 2.} {}.test u
9410: 74 66 2d 39 2e 38 2e 32 20 7b 54 63 6c 5f 55 74  tf-9.8.2 {Tcl_Ut
9420: 66 41 74 49 6e 64 65 78 3a 20 69 6e 64 65 78 20  fAtIndex: index 
9430: 3e 20 30 2c 20 45 6d 6f 6a 69 7d 20 7b 55 65 73  > 0, Emoji} {Ues
9440: 63 20 74 69 70 33 38 39 7d 20 7b 0a 20 20 20 20  c tip389} {.    
9450: 73 74 72 69 6e 67 20 72 61 6e 67 65 20 5c 55 31  string range \U1
9460: 66 36 30 30 47 20 32 20 32 0a 7d 20 47 0a 0a 74  f600G 2 2.} G..t
9470: 65 73 74 20 75 74 66 2d 31 30 2e 31 20 7b 54 63  est utf-10.1 {Tc
9480: 6c 5f 55 74 66 42 61 63 6b 73 6c 61 73 68 3a 20  l_UtfBackslash: 
9490: 64 73 74 20 3d 3d 20 4e 55 4c 4c 7d 20 7b 0a 20  dst == NULL} {. 
94a0: 20 20 20 73 65 74 20 78 20 5c 6e 0a 7d 20 7b 0a     set x \n.} {.
94b0: 7d 0a 74 65 73 74 20 75 74 66 2d 31 30 2e 32 20  }.test utf-10.2 
94c0: 7b 54 63 6c 5f 55 74 66 42 61 63 6b 73 6c 61 73  {Tcl_UtfBackslas
94d0: 68 3a 20 5c 75 20 73 75 62 73 74 7d 20 74 65 73  h: \u subst} tes
94e0: 74 62 79 74 65 73 74 72 69 6e 67 20 7b 0a 20 20  tbytestring {.  
94f0: 20 20 65 78 70 72 20 7b 22 5c 75 41 32 22 20 65    expr {"\uA2" e
9500: 71 20 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e  q [testbytestrin
9510: 67 20 5c 78 43 32 5c 78 41 32 5d 7d 0a 7d 20 31  g \xC2\xA2]}.} 1
9520: 0a 74 65 73 74 20 75 74 66 2d 31 30 2e 33 20 7b  .test utf-10.3 {
9530: 54 63 6c 5f 55 74 66 42 61 63 6b 73 6c 61 73 68  Tcl_UtfBackslash
9540: 3a 20 6c 6f 6e 67 65 72 20 5c 75 20 73 75 62 73  : longer \u subs
9550: 74 7d 20 74 65 73 74 62 79 74 65 73 74 72 69 6e  t} testbytestrin
9560: 67 20 7b 0a 20 20 20 20 65 78 70 72 20 7b 22 5c  g {.    expr {"\
9570: 75 34 45 32 31 22 20 65 71 20 5b 74 65 73 74 62  u4E21" eq [testb
9580: 79 74 65 73 74 72 69 6e 67 20 5c 78 45 34 5c 78  ytestring \xE4\x
9590: 42 38 5c 78 41 31 5d 7d 0a 7d 20 31 0a 74 65 73  B8\xA1]}.} 1.tes
95a0: 74 20 75 74 66 2d 31 30 2e 34 20 7b 54 63 6c 5f  t utf-10.4 {Tcl_
95b0: 55 74 66 42 61 63 6b 73 6c 61 73 68 3a 20 73 74  UtfBackslash: st
95c0: 6f 70 73 20 61 74 20 66 69 72 73 74 20 6e 6f 6e  ops at first non
95d0: 2d 68 65 78 7d 20 74 65 73 74 62 79 74 65 73 74  -hex} testbytest
95e0: 72 69 6e 67 20 7b 0a 20 20 20 20 65 78 70 72 20  ring {.    expr 
95f0: 7b 22 5c 75 34 45 32 6b 22 20 65 71 20 22 5b 74  {"\u4E2k" eq "[t
9600: 65 73 74 62 79 74 65 73 74 72 69 6e 67 20 5c 78  estbytestring \x
9610: 44 33 5c 78 41 32 5d 6b 22 7d 0a 7d 20 31 0a 74  D3\xA2]k"}.} 1.t
9620: 65 73 74 20 75 74 66 2d 31 30 2e 35 20 7b 54 63  est utf-10.5 {Tc
9630: 6c 5f 55 74 66 42 61 63 6b 73 6c 61 73 68 3a 20  l_UtfBackslash: 
9640: 73 74 6f 70 73 20 61 66 74 65 72 20 34 20 68 65  stops after 4 he
9650: 78 20 63 68 61 72 73 7d 20 74 65 73 74 62 79 74  x chars} testbyt
9660: 65 73 74 72 69 6e 67 20 7b 0a 20 20 20 20 65 78  estring {.    ex
9670: 70 72 20 7b 22 5c 75 34 45 32 31 36 22 20 65 71  pr {"\u4E216" eq
9680: 20 22 5b 74 65 73 74 62 79 74 65 73 74 72 69 6e   "[testbytestrin
9690: 67 20 5c 78 45 34 5c 78 42 38 5c 78 41 31 5d 36  g \xE4\xB8\xA1]6
96a0: 22 7d 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d  "}.} 1.test utf-
96b0: 31 30 2e 36 20 7b 54 63 6c 5f 55 74 66 42 61 63  10.6 {Tcl_UtfBac
96c0: 6b 73 6c 61 73 68 3a 20 73 74 6f 70 73 20 61 66  kslash: stops af
96d0: 74 65 72 20 35 20 68 65 78 20 63 68 61 72 73 7d  ter 5 hex chars}
96e0: 20 7b 55 65 73 63 20 66 75 6c 6c 75 74 66 20 74   {Uesc fullutf t
96f0: 65 73 74 62 79 74 65 73 74 72 69 6e 67 7d 20 7b  estbytestring} {
9700: 0a 20 20 20 20 65 78 70 72 20 7b 22 5c 55 31 45  .    expr {"\U1E
9710: 32 31 36 35 22 20 65 71 20 22 5b 74 65 73 74 62  2165" eq "[testb
9720: 79 74 65 73 74 72 69 6e 67 20 5c 78 46 30 5c 78  ytestring \xF0\x
9730: 39 45 5c 78 38 38 5c 78 39 36 5d 35 22 7d 0a 7d  9E\x88\x96]5"}.}
9740: 20 31 0a 74 65 73 74 20 75 74 66 2d 31 30 2e 37   1.test utf-10.7
9750: 20 7b 54 63 6c 5f 55 74 66 42 61 63 6b 73 6c 61   {Tcl_UtfBacksla
9760: 73 68 3a 20 73 74 6f 70 73 20 61 66 74 65 72 20  sh: stops after 
9770: 36 20 68 65 78 20 63 68 61 72 73 7d 20 7b 55 65  6 hex chars} {Ue
9780: 73 63 20 66 75 6c 6c 75 74 66 20 74 65 73 74 62  sc fullutf testb
9790: 79 74 65 73 74 72 69 6e 67 7d 20 7b 0a 20 20 20  ytestring} {.   
97a0: 20 65 78 70 72 20 7b 22 5c 55 31 30 45 32 31 36   expr {"\U10E216
97b0: 35 22 20 65 71 20 22 5b 74 65 73 74 62 79 74 65  5" eq "[testbyte
97c0: 73 74 72 69 6e 67 20 5c 78 46 34 5c 78 38 45 5c  string \xF4\x8E\
97d0: 78 38 38 5c 78 39 36 5d 35 22 7d 0a 7d 20 31 0a  x88\x96]5"}.} 1.
97e0: 0a 70 72 6f 63 20 62 73 43 68 65 63 6b 20 7b 63  .proc bsCheck {c
97f0: 68 61 72 20 6e 75 6d 20 7b 63 6f 6e 73 74 72 61  har num {constra
9800: 69 6e 74 73 20 7b 7d 7d 7d 20 7b 0a 20 20 20 20  ints {}}} {.    
9810: 67 6c 6f 62 61 6c 20 65 72 72 4e 75 6d 0a 20 20  global errNum.  
9820: 20 20 74 65 73 74 20 75 74 66 2d 31 30 2e 24 65    test utf-10.$e
9830: 72 72 4e 75 6d 20 7b 62 61 63 6b 73 6c 61 73 68  rrNum {backslash
9840: 20 73 75 62 73 74 69 74 75 74 69 6f 6e 7d 20 24   substitution} $
9850: 63 6f 6e 73 74 72 61 69 6e 74 73 20 7b 0a 09 73  constraints {..s
9860: 63 61 6e 20 24 63 68 61 72 20 25 63 20 76 61 6c  can $char %c val
9870: 75 65 0a 09 73 65 74 20 76 61 6c 75 65 0a 20 20  ue..set value.  
9880: 20 20 7d 20 24 6e 75 6d 0a 20 20 20 20 69 6e 63    } $num.    inc
9890: 72 20 65 72 72 4e 75 6d 0a 7d 0a 73 65 74 20 65  r errNum.}.set e
98a0: 72 72 4e 75 6d 20 38 0a 62 73 43 68 65 63 6b 20  rrNum 8.bsCheck 
98b0: 5c 62 09 38 0a 62 73 43 68 65 63 6b 20 5c 65 09  \b.8.bsCheck \e.
98c0: 31 30 31 0a 62 73 43 68 65 63 6b 20 5c 66 09 31  101.bsCheck \f.1
98d0: 32 0a 62 73 43 68 65 63 6b 20 5c 6e 09 31 30 0a  2.bsCheck \n.10.
98e0: 62 73 43 68 65 63 6b 20 5c 72 09 31 33 0a 62 73  bsCheck \r.13.bs
98f0: 43 68 65 63 6b 20 5c 74 09 39 0a 62 73 43 68 65  Check \t.9.bsChe
9900: 63 6b 20 5c 76 09 31 31 0a 62 73 43 68 65 63 6b  ck \v.11.bsCheck
9910: 20 5c 7b 09 31 32 33 0a 62 73 43 68 65 63 6b 20   \{.123.bsCheck 
9920: 5c 7d 09 31 32 35 0a 62 73 43 68 65 63 6b 20 5c  \}.125.bsCheck \
9930: 5b 09 39 31 0a 62 73 43 68 65 63 6b 20 5c 5d 09  [.91.bsCheck \].
9940: 39 33 0a 62 73 43 68 65 63 6b 20 5c 24 09 33 36  93.bsCheck \$.36
9950: 0a 62 73 43 68 65 63 6b 20 5c 20 09 33 32 0a 62  .bsCheck \ .32.b
9960: 73 43 68 65 63 6b 20 5c 3b 09 35 39 0a 62 73 43  sCheck \;.59.bsC
9970: 68 65 63 6b 20 5c 5c 09 39 32 0a 62 73 43 68 65  heck \\.92.bsChe
9980: 63 6b 20 5c 43 61 09 36 37 0a 62 73 43 68 65 63  ck \Ca.67.bsChec
9990: 6b 20 5c 4d 61 09 37 37 0a 62 73 43 68 65 63 6b  k \Ma.77.bsCheck
99a0: 20 5c 43 4d 61 09 36 37 0a 23 20 70 72 69 6f 72   \CMa.67.# prior
99b0: 20 74 6f 20 38 2e 33 2c 20 74 68 69 73 20 72 65   to 8.3, this re
99c0: 74 75 72 6e 65 64 20 38 2c 20 61 73 20 5c 38 20  turned 8, as \8 
99d0: 61 73 20 61 63 63 65 70 74 65 64 20 61 73 20 61  as accepted as a
99e0: 6e 0a 23 20 6f 63 74 61 6c 20 76 61 6c 75 65 20  n.# octal value 
99f0: 2d 20 62 75 74 20 69 74 20 69 73 6e 27 74 21 20  - but it isn't! 
9a00: 5b 42 75 67 3a 20 33 39 37 35 5d 0a 62 73 43 68  [Bug: 3975].bsCh
9a10: 65 63 6b 20 5c 38 61 09 35 36 0a 62 73 43 68 65  eck \8a.56.bsChe
9a20: 63 6b 20 5c 31 34 09 31 32 0a 62 73 43 68 65 63  ck \14.12.bsChec
9a30: 6b 20 5c 31 34 31 09 39 37 0a 62 73 43 68 65 63  k \141.97.bsChec
9a40: 6b 20 62 5c 30 09 39 38 0a 62 73 43 68 65 63 6b  k b\0.98.bsCheck
9a50: 20 5c 78 09 31 32 30 0a 62 73 43 68 65 63 6b 20   \x.120.bsCheck 
9a60: 5c 78 61 09 31 30 0a 62 73 43 68 65 63 6b 20 5c  \xa.10.bsCheck \
9a70: 78 41 09 31 30 0a 62 73 43 68 65 63 6b 20 5c 78  xA.10.bsCheck \x
9a80: 34 31 09 36 35 0a 62 73 43 68 65 63 6b 20 5c 78  41.65.bsCheck \x
9a90: 35 34 31 09 36 35 09 70 72 65 33 38 38 09 3b 23  541.65.pre388.;#
9aa0: 20 3d 3d 20 5c 78 34 31 0a 62 73 43 68 65 63 6b   == \x41.bsCheck
9ab0: 20 5c 78 35 34 31 09 38 34 09 21 70 72 65 33 38   \x541.84.!pre38
9ac0: 38 09 3b 23 20 3d 3d 20 5c 78 35 34 20 31 0a 62  8.;# == \x54 1.b
9ad0: 73 43 68 65 63 6b 20 5c 75 09 31 31 37 0a 62 73  sCheck \u.117.bs
9ae0: 43 68 65 63 6b 20 5c 75 6b 09 31 31 37 0a 62 73  Check \uk.117.bs
9af0: 43 68 65 63 6b 20 5c 75 34 31 09 36 35 0a 62 73  Check \u41.65.bs
9b00: 43 68 65 63 6b 20 5c 75 61 09 31 30 0a 62 73 43  Check \ua.10.bsC
9b10: 68 65 63 6b 20 5c 75 41 09 31 30 0a 62 73 43 68  heck \uA.10.bsCh
9b20: 65 63 6b 20 5c 33 34 30 09 32 32 34 0a 62 73 43  eck \340.224.bsC
9b30: 68 65 63 6b 20 5c 75 41 31 09 31 36 31 0a 62 73  heck \uA1.161.bs
9b40: 43 68 65 63 6b 20 5c 75 34 45 32 31 09 32 30 30  Check \u4E21.200
9b50: 30 31 0a 62 73 43 68 65 63 6b 20 5c 37 34 31 20  01.bsCheck \741 
9b60: 20 20 20 32 32 35 09 70 72 65 33 38 38 09 3b 23     225.pre388.;#
9b70: 20 3d 3d 20 5c 33 34 31 20 0a 62 73 43 68 65 63   == \341 .bsChec
9b80: 6b 20 5c 37 34 31 20 20 20 20 36 30 09 21 70 72  k \741    60.!pr
9b90: 65 33 38 38 09 3b 23 20 3d 3d 20 5c 37 34 20 31  e388.;# == \74 1
9ba0: 0a 62 73 43 68 65 63 6b 20 5c 55 20 20 20 20 20  .bsCheck \U     
9bb0: 20 38 35 0a 62 73 43 68 65 63 6b 20 5c 55 6b 20   85.bsCheck \Uk 
9bc0: 20 20 20 20 38 35 0a 62 73 43 68 65 63 6b 20 5c      85.bsCheck \
9bd0: 55 34 31 20 20 20 20 36 35 09 09 09 55 65 73 63  U41    65...Uesc
9be0: 0a 62 73 43 68 65 63 6b 20 5c 55 61 20 20 20 20  .bsCheck \Ua    
9bf0: 20 31 30 09 09 09 55 65 73 63 0a 62 73 43 68 65   10...Uesc.bsChe
9c00: 63 6b 20 5c 55 41 20 20 20 20 20 31 30 09 09 09  ck \UA     10...
9c10: 55 65 73 63 0a 62 73 43 68 65 63 6b 20 5c 55 41  Uesc.bsCheck \UA
9c20: 31 20 20 20 20 31 36 31 09 09 09 55 65 73 63 0a  1    161...Uesc.
9c30: 62 73 43 68 65 63 6b 20 5c 55 34 45 32 31 20 20  bsCheck \U4E21  
9c40: 32 30 30 30 31 09 09 09 55 65 73 63 0a 62 73 43  20001...Uesc.bsC
9c50: 68 65 63 6b 20 5c 55 30 30 34 45 32 31 20 20 20  heck \U004E21   
9c60: 20 20 20 20 20 32 30 30 30 31 09 09 55 65 73 63       20001..Uesc
9c70: 0a 62 73 43 68 65 63 6b 20 5c 55 30 30 30 30 34  .bsCheck \U00004
9c80: 45 32 31 20 20 20 20 20 20 32 30 30 30 31 09 09  E21      20001..
9c90: 55 65 73 63 0a 62 73 43 68 65 63 6b 20 5c 55 30  Uesc.bsCheck \U0
9ca0: 30 30 30 30 30 34 45 32 31 20 20 20 20 37 38 09  000004E21    78.
9cb0: 09 55 65 73 63 0a 62 73 43 68 65 63 6b 20 5c 55  .Uesc.bsCheck \U
9cc0: 30 30 31 31 30 30 30 30 20 20 20 20 20 20 36 39  00110000      69
9cd0: 36 33 32 09 09 7b 55 65 73 63 20 66 75 6c 6c 75  632..{Uesc fullu
9ce0: 74 66 7d 0a 62 73 43 68 65 63 6b 20 5c 55 30 31  tf}.bsCheck \U01
9cf0: 31 30 30 30 30 30 20 20 20 20 20 20 36 39 36 33  100000      6963
9d00: 32 09 09 7b 55 65 73 63 20 66 75 6c 6c 75 74 66  2..{Uesc fullutf
9d10: 7d 0a 62 73 43 68 65 63 6b 20 5c 55 31 31 30 30  }.bsCheck \U1100
9d20: 30 30 30 30 20 20 20 20 20 20 36 39 36 33 32 09  0000      69632.
9d30: 09 7b 55 65 73 63 20 66 75 6c 6c 75 74 66 7d 0a  .{Uesc fullutf}.
9d40: 62 73 43 68 65 63 6b 20 5c 55 30 30 31 30 46 46  bsCheck \U0010FF
9d50: 46 46 20 20 20 20 20 20 31 31 31 34 31 31 31 09  FF      1114111.
9d60: 09 7b 55 65 73 63 20 66 75 6c 6c 75 74 66 7d 0a  .{Uesc fullutf}.
9d70: 62 73 43 68 65 63 6b 20 5c 55 30 31 30 46 46 46  bsCheck \U010FFF
9d80: 46 30 20 20 20 20 20 20 31 31 31 34 31 31 31 09  F0      1114111.
9d90: 09 7b 55 65 73 63 20 66 75 6c 6c 75 74 66 7d 0a  .{Uesc fullutf}.
9da0: 62 73 43 68 65 63 6b 20 5c 55 31 30 46 46 46 46  bsCheck \U10FFFF
9db0: 30 30 20 20 20 20 20 20 31 31 31 34 31 31 31 09  00      1114111.
9dc0: 09 7b 55 65 73 63 20 66 75 6c 6c 75 74 66 7d 0a  .{Uesc fullutf}.
9dd0: 62 73 43 68 65 63 6b 20 5c 55 46 46 46 46 46 46  bsCheck \UFFFFFF
9de0: 46 46 20 20 20 20 20 20 31 30 34 38 35 37 35 09  FF      1048575.
9df0: 09 7b 55 65 73 63 20 66 75 6c 6c 75 74 66 7d 0a  .{Uesc fullutf}.
9e00: 0a 74 65 73 74 20 75 74 66 2d 31 31 2e 31 20 7b  .test utf-11.1 {
9e10: 54 63 6c 5f 55 74 66 54 6f 55 70 70 65 72 7d 20  Tcl_UtfToUpper} 
9e20: 7b 0a 20 20 20 20 73 74 72 69 6e 67 20 74 6f 75  {.    string tou
9e30: 70 70 65 72 20 7b 7d 0a 7d 20 7b 7d 0a 74 65 73  pper {}.} {}.tes
9e40: 74 20 75 74 66 2d 31 31 2e 32 20 7b 54 63 6c 5f  t utf-11.2 {Tcl_
9e50: 55 74 66 54 6f 55 70 70 65 72 7d 20 7b 0a 20 20  UtfToUpper} {.  
9e60: 20 20 73 74 72 69 6e 67 20 74 6f 75 70 70 65 72    string toupper
9e70: 20 61 62 63 0a 7d 20 41 42 43 0a 74 65 73 74 20   abc.} ABC.test 
9e80: 75 74 66 2d 31 31 2e 33 20 7b 54 63 6c 5f 55 74  utf-11.3 {Tcl_Ut
9e90: 66 54 6f 55 70 70 65 72 7d 20 7b 0a 20 20 20 20  fToUpper} {.    
9ea0: 73 74 72 69 6e 67 20 74 6f 75 70 70 65 72 20 5c  string toupper \
9eb0: 78 45 33 67 68 0a 7d 20 5c 78 43 33 47 48 0a 74  xE3gh.} \xC3GH.t
9ec0: 65 73 74 20 75 74 66 2d 31 31 2e 34 20 7b 54 63  est utf-11.4 {Tc
9ed0: 6c 5f 55 74 66 54 6f 55 70 70 65 72 7d 20 7b 0a  l_UtfToUpper} {.
9ee0: 20 20 20 20 73 74 72 69 6e 67 20 74 6f 75 70 70      string toupp
9ef0: 65 72 20 5c 75 30 31 45 33 67 68 0a 7d 20 5c 75  er \u01E3gh.} \u
9f00: 30 31 45 32 47 48 0a 74 65 73 74 20 75 74 66 2d  01E2GH.test utf-
9f10: 31 31 2e 35 20 7b 54 63 6c 5f 55 74 66 54 6f 55  11.5 {Tcl_UtfToU
9f20: 70 70 65 72 20 47 65 6f 72 67 69 61 6e 20 28 6e  pper Georgian (n
9f30: 65 77 20 69 6e 20 55 6e 69 63 6f 64 65 20 31 31  ew in Unicode 11
9f40: 29 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e 67 20  )} {.    string 
9f50: 74 6f 75 70 70 65 72 20 5c 75 31 30 44 30 5c 75  toupper \u10D0\u
9f60: 31 43 39 30 0a 7d 20 5c 75 31 43 39 30 5c 75 31  1C90.} \u1C90\u1
9f70: 43 39 30 0a 74 65 73 74 20 75 74 66 2d 31 31 2e  C90.test utf-11.
9f80: 36 20 7b 54 63 6c 5f 55 74 66 54 6f 55 70 70 65  6 {Tcl_UtfToUppe
9f90: 72 20 62 65 79 6f 6e 64 20 55 2b 46 46 46 46 7d  r beyond U+FFFF}
9fa0: 20 7b 55 65 73 63 20 66 75 6c 6c 75 74 66 7d 20   {Uesc fullutf} 
9fb0: 7b 0a 20 20 20 20 73 74 72 69 6e 67 20 74 6f 75  {.    string tou
9fc0: 70 70 65 72 20 5c 55 31 30 34 32 38 0a 7d 20 5c  pper \U10428.} \
9fd0: 55 31 30 34 30 30 0a 74 65 73 74 20 75 74 66 2d  U10400.test utf-
9fe0: 31 31 2e 37 20 7b 54 63 6c 5f 55 74 66 54 6f 55  11.7 {Tcl_UtfToU
9ff0: 70 70 65 72 20 62 65 79 6f 6e 64 20 55 2b 46 46  pper beyond U+FF
a000: 46 46 7d 20 7b 70 61 69 72 73 54 6f 34 62 79 74  FF} {pairsTo4byt
a010: 65 73 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e 67  es} {.    string
a020: 20 74 6f 75 70 70 65 72 20 5c 75 44 38 30 31 5c   toupper \uD801\
a030: 75 44 43 32 38 0a 7d 20 5c 75 44 38 30 31 5c 75  uDC28.} \uD801\u
a040: 44 43 30 30 0a 74 65 73 74 20 75 74 66 2d 31 31  DC00.test utf-11
a050: 2e 38 20 7b 54 63 6c 5f 55 74 66 54 6f 55 70 70  .8 {Tcl_UtfToUpp
a060: 65 72 20 6c 6f 77 2f 68 69 67 68 20 73 75 72 72  er low/high surr
a070: 6f 67 61 74 65 29 7d 20 7b 0a 20 20 20 20 73 74  ogate)} {.    st
a080: 72 69 6e 67 20 74 6f 75 70 70 65 72 20 5c 75 44  ring toupper \uD
a090: 43 32 34 5c 75 44 38 32 34 0a 7d 20 5c 75 44 43  C24\uD824.} \uDC
a0a0: 32 34 5c 75 44 38 32 34 0a 0a 74 65 73 74 20 75  24\uD824..test u
a0b0: 74 66 2d 31 32 2e 31 20 7b 54 63 6c 5f 55 74 66  tf-12.1 {Tcl_Utf
a0c0: 54 6f 4c 6f 77 65 72 7d 20 7b 0a 20 20 20 20 73  ToLower} {.    s
a0d0: 74 72 69 6e 67 20 74 6f 6c 6f 77 65 72 20 7b 7d  tring tolower {}
a0e0: 0a 7d 20 7b 7d 0a 74 65 73 74 20 75 74 66 2d 31  .} {}.test utf-1
a0f0: 32 2e 32 20 7b 54 63 6c 5f 55 74 66 54 6f 4c 6f  2.2 {Tcl_UtfToLo
a100: 77 65 72 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e  wer} {.    strin
a110: 67 20 74 6f 6c 6f 77 65 72 20 41 42 43 0a 7d 20  g tolower ABC.} 
a120: 61 62 63 0a 74 65 73 74 20 75 74 66 2d 31 32 2e  abc.test utf-12.
a130: 33 20 7b 54 63 6c 5f 55 74 66 54 6f 4c 6f 77 65  3 {Tcl_UtfToLowe
a140: 72 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e 67 20  r} {.    string 
a150: 74 6f 6c 6f 77 65 72 20 5c 78 43 33 47 48 0a 7d  tolower \xC3GH.}
a160: 20 5c 78 45 33 67 68 0a 74 65 73 74 20 75 74 66   \xE3gh.test utf
a170: 2d 31 32 2e 34 20 7b 54 63 6c 5f 55 74 66 54 6f  -12.4 {Tcl_UtfTo
a180: 4c 6f 77 65 72 7d 20 7b 0a 20 20 20 20 73 74 72  Lower} {.    str
a190: 69 6e 67 20 74 6f 6c 6f 77 65 72 20 5c 75 30 31  ing tolower \u01
a1a0: 45 32 47 48 0a 7d 20 5c 75 30 31 45 33 67 68 0a  E2GH.} \u01E3gh.
a1b0: 74 65 73 74 20 75 74 66 2d 31 32 2e 35 20 7b 54  test utf-12.5 {T
a1c0: 63 6c 5f 55 74 66 54 6f 4c 6f 77 65 72 20 47 65  cl_UtfToLower Ge
a1d0: 6f 72 67 69 61 6e 20 28 6e 65 77 20 69 6e 20 55  orgian (new in U
a1e0: 6e 69 63 6f 64 65 20 31 31 29 7d 20 7b 0a 20 20  nicode 11)} {.  
a1f0: 20 20 73 74 72 69 6e 67 20 74 6f 6c 6f 77 65 72    string tolower
a200: 20 5c 75 31 30 44 30 5c 75 31 43 39 30 0a 7d 20   \u10D0\u1C90.} 
a210: 5c 75 31 30 44 30 5c 75 31 30 44 30 0a 74 65 73  \u10D0\u10D0.tes
a220: 74 20 75 74 66 2d 31 32 2e 36 20 7b 54 63 6c 5f  t utf-12.6 {Tcl_
a230: 55 74 66 54 6f 4c 6f 77 65 72 20 6c 6f 77 2f 68  UtfToLower low/h
a240: 69 67 68 20 73 75 72 72 6f 67 61 74 65 29 7d 20  igh surrogate)} 
a250: 7b 0a 20 20 20 20 73 74 72 69 6e 67 20 74 6f 6c  {.    string tol
a260: 6f 77 65 72 20 5c 75 44 43 32 34 5c 75 44 38 32  ower \uDC24\uD82
a270: 34 0a 7d 20 5c 75 44 43 32 34 5c 75 44 38 32 34  4.} \uDC24\uD824
a280: 0a 74 65 73 74 20 75 74 66 2d 31 32 2e 37 20 7b  .test utf-12.7 {
a290: 54 63 6c 5f 55 74 66 54 6f 4c 6f 77 65 72 20 62  Tcl_UtfToLower b
a2a0: 65 79 6f 6e 64 20 55 2b 46 46 46 46 7d 20 7b 55  eyond U+FFFF} {U
a2b0: 65 73 63 20 66 75 6c 6c 75 74 66 7d 20 7b 0a 20  esc fullutf} {. 
a2c0: 20 20 20 73 74 72 69 6e 67 20 74 6f 6c 6f 77 65     string tolowe
a2d0: 72 20 5c 55 31 30 34 30 30 0a 7d 20 5c 55 31 30  r \U10400.} \U10
a2e0: 34 32 38 0a 74 65 73 74 20 75 74 66 2d 31 32 2e  428.test utf-12.
a2f0: 38 20 7b 54 63 6c 5f 55 74 66 54 6f 4c 6f 77 65  8 {Tcl_UtfToLowe
a300: 72 20 62 65 79 6f 6e 64 20 55 2b 46 46 46 46 7d  r beyond U+FFFF}
a310: 20 7b 70 61 69 72 73 54 6f 34 62 79 74 65 73 7d   {pairsTo4bytes}
a320: 20 7b 0a 20 20 20 20 73 74 72 69 6e 67 20 74 6f   {.    string to
a330: 6c 6f 77 65 72 20 5c 75 44 38 30 31 5c 75 44 43  lower \uD801\uDC
a340: 30 30 0a 7d 20 5c 75 44 38 30 31 5c 75 44 43 32  00.} \uD801\uDC2
a350: 38 0a 0a 74 65 73 74 20 75 74 66 2d 31 33 2e 31  8..test utf-13.1
a360: 20 7b 54 63 6c 5f 55 74 66 54 6f 54 69 74 6c 65   {Tcl_UtfToTitle
a370: 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e 67 20 74  } {.    string t
a380: 6f 74 69 74 6c 65 20 7b 7d 0a 7d 20 7b 7d 0a 74  otitle {}.} {}.t
a390: 65 73 74 20 75 74 66 2d 31 33 2e 32 20 7b 54 63  est utf-13.2 {Tc
a3a0: 6c 5f 55 74 66 54 6f 54 69 74 6c 65 7d 20 7b 0a  l_UtfToTitle} {.
a3b0: 20 20 20 20 73 74 72 69 6e 67 20 74 6f 74 69 74      string totit
a3c0: 6c 65 20 61 62 63 0a 7d 20 41 62 63 0a 74 65 73  le abc.} Abc.tes
a3d0: 74 20 75 74 66 2d 31 33 2e 33 20 7b 54 63 6c 5f  t utf-13.3 {Tcl_
a3e0: 55 74 66 54 6f 54 69 74 6c 65 7d 20 7b 0a 20 20  UtfToTitle} {.  
a3f0: 20 20 73 74 72 69 6e 67 20 74 6f 74 69 74 6c 65    string totitle
a400: 20 5c 78 45 33 47 48 0a 7d 20 5c 78 43 33 67 68   \xE3GH.} \xC3gh
a410: 0a 74 65 73 74 20 75 74 66 2d 31 33 2e 34 20 7b  .test utf-13.4 {
a420: 54 63 6c 5f 55 74 66 54 6f 54 69 74 6c 65 7d 20  Tcl_UtfToTitle} 
a430: 7b 0a 20 20 20 20 73 74 72 69 6e 67 20 74 6f 74  {.    string tot
a440: 69 74 6c 65 20 5c 75 30 31 46 33 41 42 0a 7d 20  itle \u01F3AB.} 
a450: 5c 75 30 31 46 32 61 62 0a 74 65 73 74 20 75 74  \u01F2ab.test ut
a460: 66 2d 31 33 2e 35 20 7b 54 63 6c 5f 55 74 66 54  f-13.5 {Tcl_UtfT
a470: 6f 54 69 74 6c 65 20 47 65 6f 72 67 69 61 6e 20  oTitle Georgian 
a480: 28 6e 65 77 20 69 6e 20 55 6e 69 63 6f 64 65 20  (new in Unicode 
a490: 31 31 29 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e  11)} {.    strin
a4a0: 67 20 74 6f 74 69 74 6c 65 20 5c 75 31 30 44 30  g totitle \u10D0
a4b0: 5c 75 31 43 39 30 0a 7d 20 5c 75 31 30 44 30 5c  \u1C90.} \u10D0\
a4c0: 75 31 43 39 30 0a 74 65 73 74 20 75 74 66 2d 31  u1C90.test utf-1
a4d0: 33 2e 36 20 7b 54 63 6c 5f 55 74 66 54 6f 54 69  3.6 {Tcl_UtfToTi
a4e0: 74 6c 65 20 47 65 6f 72 67 69 61 6e 20 28 6e 65  tle Georgian (ne
a4f0: 77 20 69 6e 20 55 6e 69 63 6f 64 65 20 31 31 29  w in Unicode 11)
a500: 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e 67 20 74  } {.    string t
a510: 6f 74 69 74 6c 65 20 5c 75 31 43 39 30 5c 75 31  otitle \u1C90\u1
a520: 30 44 30 0a 7d 20 5c 75 31 43 39 30 5c 75 31 30  0D0.} \u1C90\u10
a530: 44 30 0a 74 65 73 74 20 75 74 66 2d 31 33 2e 37  D0.test utf-13.7
a540: 20 7b 54 63 6c 5f 55 74 66 54 6f 54 69 74 6c 65   {Tcl_UtfToTitle
a550: 20 6c 6f 77 2f 68 69 67 68 20 73 75 72 72 6f 67   low/high surrog
a560: 61 74 65 29 7d 20 7b 0a 20 20 20 20 73 74 72 69  ate)} {.    stri
a570: 6e 67 20 74 6f 74 69 74 6c 65 20 5c 75 44 43 32  ng totitle \uDC2
a580: 34 5c 75 44 38 32 34 0a 7d 20 5c 75 44 43 32 34  4\uD824.} \uDC24
a590: 5c 75 44 38 32 34 0a 74 65 73 74 20 75 74 66 2d  \uD824.test utf-
a5a0: 31 33 2e 38 20 7b 54 63 6c 5f 55 74 66 54 6f 54  13.8 {Tcl_UtfToT
a5b0: 69 74 6c 65 20 62 65 79 6f 6e 64 20 55 2b 46 46  itle beyond U+FF
a5c0: 46 46 7d 20 7b 55 65 73 63 20 66 75 6c 6c 75 74  FF} {Uesc fullut
a5d0: 66 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e 67 20  f} {.    string 
a5e0: 74 6f 74 69 74 6c 65 20 5c 55 31 30 34 32 38 0a  totitle \U10428.
a5f0: 7d 20 5c 55 31 30 34 30 30 0a 74 65 73 74 20 75  } \U10400.test u
a600: 74 66 2d 31 33 2e 39 20 7b 54 63 6c 5f 55 74 66  tf-13.9 {Tcl_Utf
a610: 54 6f 54 69 74 6c 65 20 62 65 79 6f 6e 64 20 55  ToTitle beyond U
a620: 2b 46 46 46 46 7d 20 7b 70 61 69 72 73 54 6f 34  +FFFF} {pairsTo4
a630: 62 79 74 65 73 7d 20 7b 0a 20 20 20 20 73 74 72  bytes} {.    str
a640: 69 6e 67 20 74 6f 74 69 74 6c 65 20 5c 75 44 38  ing totitle \uD8
a650: 30 31 5c 75 44 43 32 38 0a 7d 20 5c 75 44 38 30  01\uDC28.} \uD80
a660: 31 5c 75 44 43 30 30 0a 0a 74 65 73 74 20 75 74  1\uDC00..test ut
a670: 66 2d 31 34 2e 31 20 7b 54 63 6c 5f 55 74 66 4e  f-14.1 {Tcl_UtfN
a680: 63 61 73 65 63 6d 70 7d 20 7b 0a 20 20 20 20 73  casecmp} {.    s
a690: 74 72 69 6e 67 20 63 6f 6d 70 61 72 65 20 2d 6e  tring compare -n
a6a0: 6f 63 61 73 65 20 61 20 62 0a 7d 20 2d 31 0a 74  ocase a b.} -1.t
a6b0: 65 73 74 20 75 74 66 2d 31 34 2e 32 20 7b 54 63  est utf-14.2 {Tc
a6c0: 6c 5f 55 74 66 4e 63 61 73 65 63 6d 70 7d 20 7b  l_UtfNcasecmp} {
a6d0: 0a 20 20 20 20 73 74 72 69 6e 67 20 63 6f 6d 70  .    string comp
a6e0: 61 72 65 20 2d 6e 6f 63 61 73 65 20 62 20 61 0a  are -nocase b a.
a6f0: 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 31 34 2e  } 1.test utf-14.
a700: 33 20 7b 54 63 6c 5f 55 74 66 4e 63 61 73 65 63  3 {Tcl_UtfNcasec
a710: 6d 70 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e 67  mp} {.    string
a720: 20 63 6f 6d 70 61 72 65 20 2d 6e 6f 63 61 73 65   compare -nocase
a730: 20 42 20 61 0a 7d 20 31 0a 74 65 73 74 20 75 74   B a.} 1.test ut
a740: 66 2d 31 34 2e 34 20 7b 54 63 6c 5f 55 74 66 4e  f-14.4 {Tcl_UtfN
a750: 63 61 73 65 63 6d 70 7d 20 7b 0a 20 20 20 20 73  casecmp} {.    s
a760: 74 72 69 6e 67 20 63 6f 6d 70 61 72 65 20 2d 6e  tring compare -n
a770: 6f 63 61 73 65 20 61 42 63 42 20 61 62 63 61 0a  ocase aBcB abca.
a780: 7d 20 31 0a 0a 74 65 73 74 20 75 74 66 2d 31 35  } 1..test utf-15
a790: 2e 31 20 7b 54 63 6c 5f 55 6e 69 43 68 61 72 54  .1 {Tcl_UniCharT
a7a0: 6f 55 70 70 65 72 2c 20 6e 65 67 61 74 69 76 65  oUpper, negative
a7b0: 20 64 65 6c 74 61 7d 20 7b 0a 20 20 20 20 73 74   delta} {.    st
a7c0: 72 69 6e 67 20 74 6f 75 70 70 65 72 20 61 41 0a  ring toupper aA.
a7d0: 7d 20 41 41 0a 74 65 73 74 20 75 74 66 2d 31 35  } AA.test utf-15
a7e0: 2e 32 20 7b 54 63 6c 5f 55 6e 69 43 68 61 72 54  .2 {Tcl_UniCharT
a7f0: 6f 55 70 70 65 72 2c 20 70 6f 73 69 74 69 76 65  oUpper, positive
a800: 20 64 65 6c 74 61 7d 20 7b 0a 20 20 20 20 73 74   delta} {.    st
a810: 72 69 6e 67 20 74 6f 75 70 70 65 72 20 5c 75 30  ring toupper \u0
a820: 31 37 38 5c 78 46 46 0a 7d 20 5c 75 30 31 37 38  178\xFF.} \u0178
a830: 5c 75 30 31 37 38 0a 74 65 73 74 20 75 74 66 2d  \u0178.test utf-
a840: 31 35 2e 33 20 7b 54 63 6c 5f 55 6e 69 43 68 61  15.3 {Tcl_UniCha
a850: 72 54 6f 55 70 70 65 72 2c 20 6e 6f 20 64 65 6c  rToUpper, no del
a860: 74 61 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e 67  ta} {.    string
a870: 20 74 6f 75 70 70 65 72 20 21 0a 7d 20 21 0a 0a   toupper !.} !..
a880: 74 65 73 74 20 75 74 66 2d 31 36 2e 31 20 7b 54  test utf-16.1 {T
a890: 63 6c 5f 55 6e 69 43 68 61 72 54 6f 4c 6f 77 65  cl_UniCharToLowe
a8a0: 72 2c 20 6e 65 67 61 74 69 76 65 20 64 65 6c 74  r, negative delt
a8b0: 61 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e 67 20  a} {.    string 
a8c0: 74 6f 6c 6f 77 65 72 20 61 41 0a 7d 20 61 61 0a  tolower aA.} aa.
a8d0: 74 65 73 74 20 75 74 66 2d 31 36 2e 32 20 7b 54  test utf-16.2 {T
a8e0: 63 6c 5f 55 6e 69 43 68 61 72 54 6f 4c 6f 77 65  cl_UniCharToLowe
a8f0: 72 2c 20 70 6f 73 69 74 69 76 65 20 64 65 6c 74  r, positive delt
a900: 61 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e 67 20  a} {.    string 
a910: 74 6f 6c 6f 77 65 72 20 5c 75 30 31 37 38 5c 78  tolower \u0178\x
a920: 46 46 5c 75 41 37 38 44 5c 75 30 31 43 35 5c 55  FF\uA78D\u01C5\U
a930: 31 30 34 30 30 0a 7d 20 5c 78 46 46 5c 78 46 46  10400.} \xFF\xFF
a940: 5c 75 30 32 36 35 5c 75 30 31 43 36 5c 55 31 30  \u0265\u01C6\U10
a950: 34 32 38 0a 0a 74 65 73 74 20 75 74 66 2d 31 37  428..test utf-17
a960: 2e 31 20 7b 54 63 6c 5f 55 6e 69 43 68 61 72 54  .1 {Tcl_UniCharT
a970: 6f 4c 6f 77 65 72 2c 20 6e 6f 20 64 65 6c 74 61  oLower, no delta
a980: 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e 67 20 74  } {.    string t
a990: 6f 6c 6f 77 65 72 20 21 0a 7d 20 21 0a 0a 74 65  olower !.} !..te
a9a0: 73 74 20 75 74 66 2d 31 38 2e 31 20 7b 54 63 6c  st utf-18.1 {Tcl
a9b0: 5f 55 6e 69 43 68 61 72 54 6f 54 69 74 6c 65 2c  _UniCharToTitle,
a9c0: 20 61 64 64 20 6f 6e 65 20 66 6f 72 20 74 69 74   add one for tit
a9d0: 6c 65 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e 67  le} {.    string
a9e0: 20 74 6f 74 69 74 6c 65 20 5c 75 30 31 43 34 0a   totitle \u01C4.
a9f0: 7d 20 5c 75 30 31 43 35 0a 74 65 73 74 20 75 74  } \u01C5.test ut
aa00: 66 2d 31 38 2e 32 20 7b 54 63 6c 5f 55 6e 69 43  f-18.2 {Tcl_UniC
aa10: 68 61 72 54 6f 54 69 74 6c 65 2c 20 73 75 62 74  harToTitle, subt
aa20: 72 61 63 74 20 6f 6e 65 20 66 6f 72 20 74 69 74  ract one for tit
aa30: 6c 65 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e 67  le} {.    string
aa40: 20 74 6f 74 69 74 6c 65 20 5c 75 30 31 43 36 0a   totitle \u01C6.
aa50: 7d 20 5c 75 30 31 43 35 0a 74 65 73 74 20 75 74  } \u01C5.test ut
aa60: 66 2d 31 38 2e 33 20 7b 54 63 6c 5f 55 6e 69 43  f-18.3 {Tcl_UniC
aa70: 68 61 72 54 6f 54 69 74 6c 65 2c 20 73 75 62 74  harToTitle, subt
aa80: 72 61 63 74 20 64 65 6c 74 61 20 66 6f 72 20 74  ract delta for t
aa90: 69 74 6c 65 20 28 70 6f 73 69 74 69 76 65 29 7d  itle (positive)}
aaa0: 20 7b 0a 20 20 20 20 73 74 72 69 6e 67 20 74 6f   {.    string to
aab0: 74 69 74 6c 65 20 5c 75 30 31 37 46 0a 7d 20 5c  title \u017F.} \
aac0: 78 35 33 0a 74 65 73 74 20 75 74 66 2d 31 38 2e  x53.test utf-18.
aad0: 34 20 7b 54 63 6c 5f 55 6e 69 43 68 61 72 54 6f  4 {Tcl_UniCharTo
aae0: 54 69 74 6c 65 2c 20 73 75 62 74 72 61 63 74 20  Title, subtract 
aaf0: 64 65 6c 74 61 20 66 6f 72 20 74 69 74 6c 65 20  delta for title 
ab00: 28 6e 65 67 61 74 69 76 65 29 7d 20 7b 0a 20 20  (negative)} {.  
ab10: 20 20 73 74 72 69 6e 67 20 74 6f 74 69 74 6c 65    string totitle
ab20: 20 5c 78 46 46 0a 7d 20 5c 75 30 31 37 38 0a 74   \xFF.} \u0178.t
ab30: 65 73 74 20 75 74 66 2d 31 38 2e 35 20 7b 54 63  est utf-18.5 {Tc
ab40: 6c 5f 55 6e 69 43 68 61 72 54 6f 54 69 74 6c 65  l_UniCharToTitle
ab50: 2c 20 6e 6f 20 64 65 6c 74 61 7d 20 7b 0a 20 20  , no delta} {.  
ab60: 20 20 73 74 72 69 6e 67 20 74 6f 74 69 74 6c 65    string totitle
ab70: 20 21 0a 7d 20 21 0a 0a 74 65 73 74 20 75 74 66   !.} !..test utf
ab80: 2d 31 39 2e 31 20 7b 54 63 6c 55 6e 69 43 68 61  -19.1 {TclUniCha
ab90: 72 4c 65 6e 7d 20 2d 62 6f 64 79 20 7b 0a 20 20  rLen} -body {.  
aba0: 20 20 6c 69 73 74 20 5b 72 65 67 65 78 70 20 5c    list [regexp \
abb0: 5c 64 20 61 62 63 34 35 36 64 65 66 20 66 6f 6f  \d abc456def foo
abc0: 5d 20 24 66 6f 6f 0a 7d 20 2d 63 6c 65 61 6e 75  ] $foo.} -cleanu
abd0: 70 20 7b 0a 20 20 20 20 75 6e 73 65 74 20 2d 6e  p {.    unset -n
abe0: 6f 63 6f 6d 70 6c 61 69 6e 20 66 6f 6f 0a 7d 20  ocomplain foo.} 
abf0: 2d 72 65 73 75 6c 74 20 7b 31 20 34 7d 0a 0a 74  -result {1 4}..t
ac00: 65 73 74 20 75 74 66 2d 32 30 2e 31 20 7b 54 63  est utf-20.1 {Tc
ac10: 6c 55 6e 69 43 68 61 72 4e 63 6d 70 7d 20 7b 0a  lUniCharNcmp} {.
ac20: 7d 20 7b 7d 0a 0a 74 65 73 74 20 75 74 66 2d 32  } {}..test utf-2
ac30: 31 2e 31 20 7b 54 63 6c 55 6e 69 43 68 61 72 49  1.1 {TclUniCharI
ac40: 73 41 6c 6e 75 6d 7d 20 7b 0a 20 20 20 20 23 20  sAlnum} {.    # 
ac50: 74 68 69 73 20 72 65 74 75 72 6e 73 20 31 20 77  this returns 1 w
ac60: 69 74 68 20 55 6e 69 63 6f 64 65 20 37 20 63 6f  ith Unicode 7 co
ac70: 6d 70 6c 69 61 6e 63 65 0a 20 20 20 20 73 74 72  mpliance.    str
ac80: 69 6e 67 20 69 73 20 61 6c 6e 75 6d 20 5c 75 31  ing is alnum \u1
ac90: 30 34 30 5c 75 30 32 31 46 5c 75 30 32 32 30 0a  040\u021F\u0220.
aca0: 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 32 31 2e  } 1.test utf-21.
acb0: 32 20 7b 75 6e 69 63 6f 64 65 20 61 6c 6e 75 6d  2 {unicode alnum
acc0: 20 63 68 61 72 20 69 6e 20 72 65 67 63 5f 6c 6f   char in regc_lo
acd0: 63 61 6c 65 2e 63 7d 20 7b 0a 20 20 20 20 23 20  cale.c} {.    # 
ace0: 74 68 69 73 20 72 65 74 75 72 6e 73 20 31 20 77  this returns 1 w
acf0: 69 74 68 20 55 6e 69 63 6f 64 65 20 37 20 63 6f  ith Unicode 7 co
ad00: 6d 70 6c 69 61 6e 63 65 0a 20 20 20 20 6c 69 73  mpliance.    lis
ad10: 74 20 5b 72 65 67 65 78 70 20 7b 5e 5b 5b 3a 61  t [regexp {^[[:a
ad20: 6c 6e 75 6d 3a 5d 5d 2b 24 7d 20 5c 75 31 30 34  lnum:]]+$} \u104
ad30: 30 5c 75 30 32 31 46 5c 75 30 32 32 30 5d 20 5b  0\u021F\u0220] [
ad40: 72 65 67 65 78 70 20 7b 5e 5c 77 2b 24 7d 20 5c  regexp {^\w+$} \
ad50: 75 31 30 34 30 5c 75 30 32 31 46 5c 75 30 32 32  u1040\u021F\u022
ad60: 30 5f 5c 75 32 30 33 46 5c 75 32 30 34 30 5c 75  0_\u203F\u2040\u
ad70: 32 30 35 34 5c 75 46 45 33 33 5c 75 46 45 33 34  2054\uFE33\uFE34
ad80: 5c 75 46 45 34 44 5c 75 46 45 34 45 5c 75 46 45  \uFE4D\uFE4E\uFE
ad90: 34 46 5c 75 46 46 33 46 5d 0a 7d 20 7b 31 20 31  4F\uFF3F].} {1 1
ada0: 7d 0a 74 65 73 74 20 75 74 66 2d 32 31 2e 33 20  }.test utf-21.3 
adb0: 7b 75 6e 69 63 6f 64 65 20 70 72 69 6e 74 20 63  {unicode print c
adc0: 68 61 72 20 69 6e 20 72 65 67 63 5f 6c 6f 63 61  har in regc_loca
add0: 6c 65 2e 63 7d 20 7b 0a 20 20 20 20 23 20 74 68  le.c} {.    # th
ade0: 69 73 20 72 65 74 75 72 6e 73 20 31 20 77 69 74  is returns 1 wit
adf0: 68 20 55 6e 69 63 6f 64 65 20 37 20 63 6f 6d 70  h Unicode 7 comp
ae00: 6c 69 61 6e 63 65 0a 20 20 20 20 72 65 67 65 78  liance.    regex
ae10: 70 20 7b 5e 5b 5b 3a 70 72 69 6e 74 3a 5d 5d 2b  p {^[[:print:]]+
ae20: 24 7d 20 5c 75 46 42 43 31 0a 7d 20 31 0a 74 65  $} \uFBC1.} 1.te
ae30: 73 74 20 75 74 66 2d 32 31 2e 34 20 7b 54 63 6c  st utf-21.4 {Tcl
ae40: 55 6e 69 43 68 61 72 49 73 47 72 61 70 68 7d 20  UniCharIsGraph} 
ae50: 7b 0a 20 20 20 20 23 20 5b 42 75 67 20 33 34 36  {.    # [Bug 346
ae60: 34 34 32 38 5d 0a 20 20 20 20 73 74 72 69 6e 67  4428].    string
ae70: 20 69 73 20 67 72 61 70 68 20 5c 75 30 31 32 30   is graph \u0120
ae80: 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 32 31  .} 1.test utf-21
ae90: 2e 35 20 7b 75 6e 69 63 6f 64 65 20 67 72 61 70  .5 {unicode grap
aea0: 68 20 63 68 61 72 20 69 6e 20 72 65 67 63 5f 6c  h char in regc_l
aeb0: 6f 63 61 6c 65 2e 63 7d 20 7b 0a 20 20 20 20 23  ocale.c} {.    #
aec0: 20 5b 42 75 67 20 33 34 36 34 34 32 38 5d 0a 20   [Bug 3464428]. 
aed0: 20 20 20 72 65 67 65 78 70 20 7b 5e 5b 5b 3a 67     regexp {^[[:g
aee0: 72 61 70 68 3a 5d 5d 2b 24 7d 20 5c 75 30 31 32  raph:]]+$} \u012
aef0: 30 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 32  0.} 1.test utf-2
af00: 31 2e 36 20 7b 54 63 6c 55 6e 69 43 68 61 72 49  1.6 {TclUniCharI
af10: 73 47 72 61 70 68 7d 20 7b 0a 20 20 20 20 23 20  sGraph} {.    # 
af20: 5b 42 75 67 20 33 34 36 34 34 32 38 5d 0a 20 20  [Bug 3464428].  
af30: 20 20 73 74 72 69 6e 67 20 69 73 20 67 72 61 70    string is grap
af40: 68 20 5c 78 41 30 0a 7d 20 30 0a 74 65 73 74 20  h \xA0.} 0.test 
af50: 75 74 66 2d 32 31 2e 37 20 7b 75 6e 69 63 6f 64  utf-21.7 {unicod
af60: 65 20 67 72 61 70 68 20 63 68 61 72 20 69 6e 20  e graph char in 
af70: 72 65 67 63 5f 6c 6f 63 61 6c 65 2e 63 7d 20 7b  regc_locale.c} {
af80: 0a 20 20 20 20 23 20 5b 42 75 67 20 33 34 36 34  .    # [Bug 3464
af90: 34 32 38 5d 0a 20 20 20 20 72 65 67 65 78 70 20  428].    regexp 
afa0: 7b 5b 5b 3a 67 72 61 70 68 3a 5d 5d 7d 20 5c 78  {[[:graph:]]} \x
afb0: 32 30 5c 78 41 30 5c 75 32 30 32 38 5c 75 32 30  20\xA0\u2028\u20
afc0: 32 39 0a 7d 20 30 0a 74 65 73 74 20 75 74 66 2d  29.} 0.test utf-
afd0: 32 31 2e 38 20 7b 54 63 6c 55 6e 69 43 68 61 72  21.8 {TclUniChar
afe0: 49 73 50 72 69 6e 74 7d 20 7b 0a 20 20 20 20 23  IsPrint} {.    #
aff0: 20 5b 42 75 67 20 33 34 36 34 34 32 38 5d 0a 20   [Bug 3464428]. 
b000: 20 20 20 73 74 72 69 6e 67 20 69 73 20 70 72 69     string is pri
b010: 6e 74 20 5c 78 30 39 0a 7d 20 30 0a 74 65 73 74  nt \x09.} 0.test
b020: 20 75 74 66 2d 32 31 2e 39 20 7b 75 6e 69 63 6f   utf-21.9 {unico
b030: 64 65 20 70 72 69 6e 74 20 63 68 61 72 20 69 6e  de print char in
b040: 20 72 65 67 63 5f 6c 6f 63 61 6c 65 2e 63 7d 20   regc_locale.c} 
b050: 7b 0a 20 20 20 20 23 20 5b 42 75 67 20 33 34 36  {.    # [Bug 346
b060: 34 34 32 38 5d 0a 20 20 20 20 72 65 67 65 78 70  4428].    regexp
b070: 20 7b 5b 5b 3a 70 72 69 6e 74 3a 5d 5d 7d 20 5c   {[[:print:]]} \
b080: 78 30 39 0a 7d 20 30 0a 74 65 73 74 20 75 74 66  x09.} 0.test utf
b090: 2d 32 31 2e 31 30 20 7b 75 6e 69 63 6f 64 65 20  -21.10 {unicode 
b0a0: 70 72 69 6e 74 20 63 68 61 72 20 69 6e 20 72 65  print char in re
b0b0: 67 63 5f 6c 6f 63 61 6c 65 2e 63 7d 20 7b 0a 20  gc_locale.c} {. 
b0c0: 20 20 20 23 20 5b 42 75 67 20 33 34 36 34 34 32     # [Bug 346442
b0d0: 38 5d 0a 20 20 20 20 72 65 67 65 78 70 20 7b 5b  8].    regexp {[
b0e0: 5b 3a 70 72 69 6e 74 3a 5d 5d 7d 20 5c 78 30 39  [:print:]]} \x09
b0f0: 0a 7d 20 30 0a 74 65 73 74 20 75 74 66 2d 32 31  .} 0.test utf-21
b100: 2e 31 31 20 7b 54 63 6c 55 6e 69 43 68 61 72 49  .11 {TclUniCharI
b110: 73 43 6f 6e 74 72 6f 6c 7d 20 7b 0a 20 20 20 20  sControl} {.    
b120: 23 20 5b 42 75 67 20 33 34 36 34 34 32 38 5d 0a  # [Bug 3464428].
b130: 20 20 20 20 73 74 72 69 6e 67 20 69 73 20 63 6f      string is co
b140: 6e 74 72 6f 6c 20 5c 78 30 30 5c 78 31 46 5c 78  ntrol \x00\x1F\x
b150: 41 44 5c 75 30 36 30 35 5c 75 30 36 31 43 5c 75  AD\u0605\u061C\u
b160: 31 38 30 45 5c 75 32 30 36 36 5c 75 46 45 46 46  180E\u2066\uFEFF
b170: 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d 32 31  .} 1.test utf-21
b180: 2e 31 32 20 7b 75 6e 69 63 6f 64 65 20 63 6f 6e  .12 {unicode con
b190: 74 72 6f 6c 20 63 68 61 72 20 69 6e 20 72 65 67  trol char in reg
b1a0: 63 5f 6c 6f 63 61 6c 65 2e 63 7d 20 7b 0a 20 20  c_locale.c} {.  
b1b0: 20 20 23 20 5b 42 75 67 20 33 34 36 34 34 32 38    # [Bug 3464428
b1c0: 5d 2c 20 5b 42 75 67 20 61 38 37 36 36 34 36 65  ], [Bug a876646e
b1d0: 66 65 5d 0a 20 20 20 20 72 65 67 65 78 70 20 7b  fe].    regexp {
b1e0: 5e 5b 5b 3a 63 6e 74 72 6c 3a 5d 5d 2a 24 7d 20  ^[[:cntrl:]]*$} 
b1f0: 5c 78 30 30 5c 78 31 46 5c 78 41 44 5c 75 30 36  \x00\x1F\xAD\u06
b200: 30 35 5c 75 30 36 31 43 5c 75 31 38 30 45 5c 75  05\u061C\u180E\u
b210: 32 30 36 36 5c 75 46 45 46 46 0a 7d 20 31 0a 0a  2066\uFEFF.} 1..
b220: 74 65 73 74 20 75 74 66 2d 32 32 2e 31 20 7b 54  test utf-22.1 {T
b230: 63 6c 55 6e 69 43 68 61 72 49 73 57 6f 72 64 43  clUniCharIsWordC
b240: 68 61 72 7d 20 7b 0a 20 20 20 20 73 74 72 69 6e  har} {.    strin
b250: 67 20 77 6f 72 64 65 6e 64 20 22 78 79 7a 31 32  g wordend "xyz12
b260: 33 5f 62 61 72 20 66 67 22 20 30 0a 7d 20 31 30  3_bar fg" 0.} 10
b270: 0a 74 65 73 74 20 75 74 66 2d 32 32 2e 32 20 7b  .test utf-22.2 {
b280: 54 63 6c 55 6e 69 43 68 61 72 49 73 57 6f 72 64  TclUniCharIsWord
b290: 43 68 61 72 7d 20 7b 0a 20 20 20 20 73 74 72 69  Char} {.    stri
b2a0: 6e 67 20 77 6f 72 64 65 6e 64 20 22 78 5c 75 35  ng wordend "x\u5
b2b0: 30 38 30 7a 31 32 33 5f 62 61 72 5c 75 32 30 33  080z123_bar\u203
b2c0: 43 20 66 67 22 20 30 0a 7d 20 31 30 0a 0a 74 65  C fg" 0.} 10..te
b2d0: 73 74 20 75 74 66 2d 32 33 2e 31 20 7b 54 63 6c  st utf-23.1 {Tcl
b2e0: 55 6e 69 43 68 61 72 49 73 41 6c 70 68 61 7d 20  UniCharIsAlpha} 
b2f0: 7b 0a 20 20 20 20 23 20 74 68 69 73 20 72 65 74  {.    # this ret
b300: 75 72 6e 73 20 31 20 77 69 74 68 20 55 6e 69 63  urns 1 with Unic
b310: 6f 64 65 20 37 20 63 6f 6d 70 6c 69 61 6e 63 65  ode 7 compliance
b320: 0a 20 20 20 20 73 74 72 69 6e 67 20 69 73 20 61  .    string is a
b330: 6c 70 68 61 20 5c 75 30 32 31 46 5c 75 30 32 32  lpha \u021F\u022
b340: 30 5c 75 30 33 37 46 5c 75 30 35 32 46 0a 7d 20  0\u037F\u052F.} 
b350: 31 0a 74 65 73 74 20 75 74 66 2d 32 33 2e 32 20  1.test utf-23.2 
b360: 7b 75 6e 69 63 6f 64 65 20 61 6c 70 68 61 20 63  {unicode alpha c
b370: 68 61 72 20 69 6e 20 72 65 67 63 5f 6c 6f 63 61  har in regc_loca
b380: 6c 65 2e 63 7d 20 7b 0a 20 20 20 20 23 20 74 68  le.c} {.    # th
b390: 69 73 20 72 65 74 75 72 6e 73 20 31 20 77 69 74  is returns 1 wit
b3a0: 68 20 55 6e 69 63 6f 64 65 20 37 20 63 6f 6d 70  h Unicode 7 comp
b3b0: 6c 69 61 6e 63 65 0a 20 20 20 20 72 65 67 65 78  liance.    regex
b3c0: 70 20 7b 5e 5b 5b 3a 61 6c 70 68 61 3a 5d 5d 2b  p {^[[:alpha:]]+
b3d0: 24 7d 20 5c 75 30 32 31 46 5c 75 30 32 32 30 5c  $} \u021F\u0220\
b3e0: 75 30 33 37 46 5c 75 30 35 32 46 0a 7d 20 31 0a  u037F\u052F.} 1.
b3f0: 0a 74 65 73 74 20 75 74 66 2d 32 34 2e 31 20 7b  .test utf-24.1 {
b400: 54 63 6c 55 6e 69 43 68 61 72 49 73 44 69 67 69  TclUniCharIsDigi
b410: 74 7d 20 7b 0a 20 20 20 20 23 20 74 68 69 73 20  t} {.    # this 
b420: 72 65 74 75 72 6e 73 20 31 20 77 69 74 68 20 55  returns 1 with U
b430: 6e 69 63 6f 64 65 20 37 20 63 6f 6d 70 6c 69 61  nicode 7 complia
b440: 6e 63 65 0a 20 20 20 20 73 74 72 69 6e 67 20 69  nce.    string i
b450: 73 20 64 69 67 69 74 20 5c 75 31 30 34 30 5c 75  s digit \u1040\u
b460: 41 42 46 30 0a 7d 20 31 0a 74 65 73 74 20 75 74  ABF0.} 1.test ut
b470: 66 2d 32 34 2e 32 20 7b 75 6e 69 63 6f 64 65 20  f-24.2 {unicode 
b480: 64 69 67 69 74 20 63 68 61 72 20 69 6e 20 72 65  digit char in re
b490: 67 63 5f 6c 6f 63 61 6c 65 2e 63 7d 20 7b 0a 20  gc_locale.c} {. 
b4a0: 20 20 20 23 20 74 68 69 73 20 72 65 74 75 72 6e     # this return
b4b0: 73 20 31 20 77 69 74 68 20 55 6e 69 63 6f 64 65  s 1 with Unicode
b4c0: 20 37 20 63 6f 6d 70 6c 69 61 6e 63 65 0a 20 20   7 compliance.  
b4d0: 20 20 6c 69 73 74 20 5b 72 65 67 65 78 70 20 7b    list [regexp {
b4e0: 5e 5b 5b 3a 64 69 67 69 74 3a 5d 5d 2b 24 7d 20  ^[[:digit:]]+$} 
b4f0: 5c 75 31 30 34 30 5c 75 41 42 46 30 5d 20 5b 72  \u1040\uABF0] [r
b500: 65 67 65 78 70 20 7b 5e 5c 64 2b 24 7d 20 5c 75  egexp {^\d+$} \u
b510: 31 30 34 30 5c 75 41 42 46 30 5d 0a 7d 20 7b 31  1040\uABF0].} {1
b520: 20 31 7d 0a 0a 74 65 73 74 20 75 74 66 2d 32 34   1}..test utf-24
b530: 2e 33 20 7b 54 63 6c 55 6e 69 43 68 61 72 49 73  .3 {TclUniCharIs
b540: 53 70 61 63 65 7d 20 7b 0a 20 20 20 20 23 20 74  Space} {.    # t
b550: 68 69 73 20 72 65 74 75 72 6e 73 20 31 20 77 69  his returns 1 wi
b560: 74 68 20 55 6e 69 63 6f 64 65 20 37 20 63 6f 6d  th Unicode 7 com
b570: 70 6c 69 61 6e 63 65 0a 20 20 20 20 73 74 72 69  pliance.    stri
b580: 6e 67 20 69 73 20 73 70 61 63 65 20 5c 75 31 36  ng is space \u16
b590: 38 30 5c 75 31 38 30 45 5c 75 32 30 32 46 0a 7d  80\u180E\u202F.}
b5a0: 20 31 0a 74 65 73 74 20 75 74 66 2d 32 34 2e 34   1.test utf-24.4
b5b0: 20 7b 75 6e 69 63 6f 64 65 20 73 70 61 63 65 20   {unicode space 
b5c0: 63 68 61 72 20 69 6e 20 72 65 67 63 5f 6c 6f 63  char in regc_loc
b5d0: 61 6c 65 2e 63 7d 20 7b 0a 20 20 20 20 23 20 74  ale.c} {.    # t
b5e0: 68 69 73 20 72 65 74 75 72 6e 73 20 31 20 77 69  his returns 1 wi
b5f0: 74 68 20 55 6e 69 63 6f 64 65 20 37 20 63 6f 6d  th Unicode 7 com
b600: 70 6c 69 61 6e 63 65 0a 20 20 20 20 6c 69 73 74  pliance.    list
b610: 20 5b 72 65 67 65 78 70 20 7b 5e 5b 5b 3a 73 70   [regexp {^[[:sp
b620: 61 63 65 3a 5d 5d 2b 24 7d 20 5c 75 31 36 38 30  ace:]]+$} \u1680
b630: 5c 75 31 38 30 45 5c 75 32 30 32 46 5d 20 5b 72  \u180E\u202F] [r
b640: 65 67 65 78 70 20 7b 5e 5c 73 2b 24 7d 20 5c 75  egexp {^\s+$} \u
b650: 31 36 38 30 5c 75 31 38 30 45 5c 75 32 30 32 46  1680\u180E\u202F
b660: 5d 0a 7d 20 7b 31 20 31 7d 0a 74 65 73 74 20 75  ].} {1 1}.test u
b670: 74 66 2d 32 34 2e 35 20 7b 54 63 6c 55 6e 69 43  tf-24.5 {TclUniC
b680: 68 61 72 49 73 53 70 61 63 65 7d 20 74 69 70 34  harIsSpace} tip4
b690: 31 33 20 7b 0a 20 20 20 20 23 20 74 68 69 73 20  13 {.    # this 
b6a0: 72 65 74 75 72 6e 73 20 31 20 77 69 74 68 20 55  returns 1 with U
b6b0: 6e 69 63 6f 64 65 20 37 2f 54 49 50 20 34 31 33  nicode 7/TIP 413
b6c0: 20 63 6f 6d 70 6c 69 61 6e 63 65 0a 20 20 20 20   compliance.    
b6d0: 73 74 72 69 6e 67 20 69 73 20 73 70 61 63 65 20  string is space 
b6e0: 5c 78 38 35 5c 75 31 36 38 30 5c 75 31 38 30 45  \x85\u1680\u180E
b6f0: 5c 75 32 30 30 42 5c 75 32 30 32 46 5c 75 32 30  \u200B\u202F\u20
b700: 36 30 0a 7d 20 31 0a 74 65 73 74 20 75 74 66 2d  60.} 1.test utf-
b710: 32 34 2e 36 20 7b 75 6e 69 63 6f 64 65 20 73 70  24.6 {unicode sp
b720: 61 63 65 20 63 68 61 72 20 69 6e 20 72 65 67 63  ace char in regc
b730: 5f 6c 6f 63 61 6c 65 2e 63 7d 20 74 69 70 34 31  _locale.c} tip41
b740: 33 20 7b 0a 20 20 20 20 23 20 74 68 69 73 20 72  3 {.    # this r
b750: 65 74 75 72 6e 73 20 31 20 77 69 74 68 20 55 6e  eturns 1 with Un
b760: 69 63 6f 64 65 20 37 2f 54 49 50 20 34 31 33 20  icode 7/TIP 413 
b770: 63 6f 6d 70 6c 69 61 6e 63 65 0a 20 20 20 20 6c  compliance.    l
b780: 69 73 74 20 5b 72 65 67 65 78 70 20 7b 5e 5b 5b  ist [regexp {^[[
b790: 3a 73 70 61 63 65 3a 5d 5d 2b 24 7d 20 5c 78 38  :space:]]+$} \x8
b7a0: 35 5c 75 31 36 38 30 5c 75 31 38 30 45 5c 75 32  5\u1680\u180E\u2
b7b0: 30 30 42 5c 75 32 30 32 46 5c 75 32 30 36 30 5d  00B\u202F\u2060]
b7c0: 20 5b 72 65 67 65 78 70 20 7b 5e 5c 73 2b 24 7d   [regexp {^\s+$}
b7d0: 20 5c 78 38 35 5c 75 31 36 38 30 5c 75 31 38 30   \x85\u1680\u180
b7e0: 45 5c 75 32 30 30 42 5c 75 32 30 32 46 5c 75 32  E\u200B\u202F\u2
b7f0: 30 36 30 5d 0a 7d 20 7b 31 20 31 7d 0a 0a 70 72  060].} {1 1}..pr
b800: 6f 63 20 55 6e 69 43 68 61 72 43 61 73 65 43 6d  oc UniCharCaseCm
b810: 70 54 65 73 74 20 7b 6f 72 64 65 72 20 6f 6e 65  pTest {order one
b820: 20 74 77 6f 20 7b 63 6f 6e 73 74 72 61 69 6e 74   two {constraint
b830: 73 20 7b 7d 7d 7d 20 7b 0a 20 20 20 20 76 61 72  s {}}} {.    var
b840: 69 61 62 6c 65 20 63 6f 75 6e 74 0a 20 20 20 20  iable count.    
b850: 74 65 73 74 20 75 74 66 2d 32 35 2e 24 63 6f 75  test utf-25.$cou
b860: 6e 74 20 7b 54 63 6c 5f 55 6e 69 43 68 61 72 4e  nt {Tcl_UniCharN
b870: 63 61 73 65 63 6d 70 7d 20 2d 73 65 74 75 70 20  casecmp} -setup 
b880: 7b 0a 09 74 65 73 74 6f 62 6a 20 66 72 65 65 61  {..testobj freea
b890: 6c 6c 76 61 72 73 0a 20 20 20 20 7d 20 2d 63 6f  llvars.    } -co
b8a0: 6e 73 74 72 61 69 6e 74 73 20 5b 6c 69 6e 73 65  nstraints [linse
b8b0: 72 74 20 24 63 6f 6e 73 74 72 61 69 6e 74 73 20  rt $constraints 
b8c0: 30 20 74 65 73 74 73 74 72 69 6e 67 6f 62 6a 5d  0 teststringobj]
b8d0: 20 2d 63 6c 65 61 6e 75 70 20 7b 0a 09 74 65 73   -cleanup {..tes
b8e0: 74 6f 62 6a 20 66 72 65 65 61 6c 6c 76 61 72 73  tobj freeallvars
b8f0: 0a 20 20 20 20 7d 20 2d 62 6f 64 79 20 7b 0a 09  .    } -body {..
b900: 74 65 73 74 73 74 72 69 6e 67 6f 62 6a 20 73 65  teststringobj se
b910: 74 20 31 20 24 6f 6e 65 0a 09 74 65 73 74 73 74  t 1 $one..testst
b920: 72 69 6e 67 6f 62 6a 20 73 65 74 20 32 20 24 74  ringobj set 2 $t
b930: 77 6f 0a 09 74 65 73 74 73 74 72 69 6e 67 6f 62  wo..teststringob
b940: 6a 20 6d 61 78 63 68 61 72 73 20 31 0a 09 74 65  j maxchars 1..te
b950: 73 74 73 74 72 69 6e 67 6f 62 6a 20 6d 61 78 63  ststringobj maxc
b960: 68 61 72 73 20 32 0a 09 73 65 74 20 72 65 73 75  hars 2..set resu
b970: 6c 74 20 5b 73 74 72 69 6e 67 20 63 6f 6d 70 61  lt [string compa
b980: 72 65 20 2d 6e 6f 63 61 73 65 20 5b 74 65 73 74  re -nocase [test
b990: 73 74 72 69 6e 67 6f 62 6a 20 67 65 74 20 31 5d  stringobj get 1]
b9a0: 20 5b 74 65 73 74 73 74 72 69 6e 67 6f 62 6a 20   [teststringobj 
b9b0: 67 65 74 20 32 5d 5d 0a 09 69 66 20 7b 24 72 65  get 2]]..if {$re
b9c0: 73 75 6c 74 20 65 71 20 5b 73 74 72 69 6e 67 20  sult eq [string 
b9d0: 6d 61 70 20 7b 3c 20 2d 31 20 3d 20 30 20 3e 20  map {< -1 = 0 > 
b9e0: 31 7d 20 24 6f 72 64 65 72 5d 7d 20 7b 0a 09 20  1} $order]} {.. 
b9f0: 20 20 20 73 65 74 20 72 65 73 75 6c 74 20 6f 6b     set result ok
ba00: 0a 09 7d 20 65 6c 73 65 20 7b 0a 09 20 20 20 20  ..} else {..    
ba10: 73 65 74 20 72 65 73 75 6c 74 20 22 27 24 6f 6e  set result "'$on
ba20: 65 27 20 73 68 6f 75 6c 64 20 62 65 20 24 6f 72  e' should be $or
ba30: 64 65 72 20 27 24 74 77 6f 27 20 28 6e 6f 20 63  der '$two' (no c
ba40: 61 73 65 29 22 0a 09 7d 0a 09 73 65 74 20 72 65  ase)"..}..set re
ba50: 73 75 6c 74 0a 20 20 20 20 7d 20 2d 72 65 73 75  sult.    } -resu
ba60: 6c 74 20 6f 6b 0a 20 20 20 20 69 6e 63 72 20 63  lt ok.    incr c
ba70: 6f 75 6e 74 0a 7d 0a 76 61 72 69 61 62 6c 65 20  ount.}.variable 
ba80: 63 6f 75 6e 74 20 31 0a 55 6e 69 43 68 61 72 43  count 1.UniCharC
ba90: 61 73 65 43 6d 70 54 65 73 74 20 3c 20 61 20 62  aseCmpTest < a b
baa0: 0a 55 6e 69 43 68 61 72 43 61 73 65 43 6d 70 54  .UniCharCaseCmpT
bab0: 65 73 74 20 3e 20 62 20 61 0a 55 6e 69 43 68 61  est > b a.UniCha
bac0: 72 43 61 73 65 43 6d 70 54 65 73 74 20 3e 20 42  rCaseCmpTest > B
bad0: 20 61 0a 55 6e 69 43 68 61 72 43 61 73 65 43 6d   a.UniCharCaseCm
bae0: 70 54 65 73 74 20 3e 20 61 42 63 42 20 61 62 63  pTest > aBcB abc
baf0: 61 0a 55 6e 69 43 68 61 72 43 61 73 65 43 6d 70  a.UniCharCaseCmp
bb00: 54 65 73 74 20 3c 20 5c 75 46 46 46 46 20 5b 66  Test < \uFFFF [f
bb10: 6f 72 6d 61 74 20 25 63 20 30 78 31 30 30 30 30  ormat %c 0x10000
bb20: 5d 09 7b 66 75 6c 6c 75 74 66 20 6b 6e 6f 77 6e  ].{fullutf known
bb30: 42 75 67 7d 0a 55 6e 69 43 68 61 72 43 61 73 65  Bug}.UniCharCase
bb40: 43 6d 70 54 65 73 74 20 3c 20 5c 75 46 46 46 46  CmpTest < \uFFFF
bb50: 20 5c 55 31 30 30 30 30 09 09 7b 55 65 73 63 20   \U10000..{Uesc 
bb60: 66 75 6c 6c 75 74 66 20 6b 6e 6f 77 6e 42 75 67  fullutf knownBug
bb70: 7d 0a 0a 0a 0a 0a 0a 75 6e 73 65 74 20 63 6f 75  }......unset cou
bb80: 6e 74 0a 72 65 6e 61 6d 65 20 55 6e 69 43 68 61  nt.rename UniCha
bb90: 72 43 61 73 65 43 6d 70 54 65 73 74 20 7b 7d 0a  rCaseCmpTest {}.
bba0: 0a 23 20 63 6c 65 61 6e 75 70 0a 3a 3a 74 63 6c  .# cleanup.::tcl
bbb0: 74 65 73 74 3a 3a 63 6c 65 61 6e 75 70 54 65 73  test::cleanupTes
bbc0: 74 73 0a 72 65 74 75 72 6e 0a 0a 23 20 4c 6f 63  ts.return..# Loc
bbd0: 61 6c 20 56 61 72 69 61 62 6c 65 73 3a 0a 23 20  al Variables:.# 
bbe0: 6d 6f 64 65 3a 20 74 63 6c 0a 23 20 45 6e 64 3a  mode: tcl.# End:
bbf0: 0a                                               .