diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-11-14 14:01:13 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-11-14 14:01:13 (GMT) |
commit | 37076881576fb0897e3c1c257ca37cd87685da0c (patch) | |
tree | c7fc943958a4cfb5de364da908cb7f66d20fccea /tests | |
parent | ed907ec2d18048ab42baa3a8a6b4436894dc8912 (diff) | |
download | tcl-37076881576fb0897e3c1c257ca37cd87685da0c.zip tcl-37076881576fb0897e3c1c257ca37cd87685da0c.tar.gz tcl-37076881576fb0897e3c1c257ca37cd87685da0c.tar.bz2 |
Better - more complete - fix for [d433c0e0ad]: TCL_UTF_MAX == 4 problems. It allows emoji to be produced by the system encoding, even for other values of TCL_UTF_MAX.
Also added test-cases for this.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/encoding.test | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/encoding.test b/tests/encoding.test index ed0e6a4..cf27190 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -328,6 +328,22 @@ test encoding-15.3 {UtfToUtfProc null character input} { binary scan [encoding convertto identity $y] H* z list [string bytelength $x] [string bytelength $y] $z } {1 2 c080} +test encoding-15.4 {UtfToUtfProc emoji character input} { + set x \xED\xA0\xBD\xED\xB8\x82 + set y [encoding convertfrom utf-8 \xED\xA0\xBD\xED\xB8\x82] + list [string length $x] [string length $y] $y +} "6 2 \uD83D\uDE02" +test encoding-15.5 {UtfToUtfProc emoji character input} { + set x \xF0\x9F\x98\x82 + set y [encoding convertfrom utf-8 \xF0\x9F\x98\x82] + list [string length $x] [string length $y] $y +} "4 2 \uD83D\uDE02" +test encoding-15.6 {UtfToUtfProc emoji character output} { + set x \uD83D\uDE02 + set y [encoding convertto utf-8 \uD83D\uDE02] + binary scan $y H* z + list [string length $x] [string length $y] $z +} {2 4 f09f9882} test encoding-16.1 {UnicodeToUtfProc} { set val [encoding convertfrom unicode NN] |