diff options
| author | rmax <rmax> | 2004-05-27 14:33:17 (GMT) |
|---|---|---|
| committer | rmax <rmax> | 2004-05-27 14:33:17 (GMT) |
| commit | c288045e306ede150caa3a2988539ebfd0b1e14a (patch) | |
| tree | 6e898823663aba6bffb15a7c24b317772aa4b0ec /tests/encoding.test | |
| parent | 99a7343ec31e83f227c9bbb4f1930f7249a2450b (diff) | |
| download | tcl-c288045e306ede150caa3a2988539ebfd0b1e14a.zip tcl-c288045e306ede150caa3a2988539ebfd0b1e14a.tar.gz tcl-c288045e306ede150caa3a2988539ebfd0b1e14a.tar.bz2 | |
* generic/tclEncoding.c:
* tests/encoding.test: added support and tests for translating
embedded null characters between real nullbytes and the internal
representation on input/output (Bug #949905).
Diffstat (limited to 'tests/encoding.test')
| -rw-r--r-- | tests/encoding.test | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/encoding.test b/tests/encoding.test index 90ce6d4..83f5f69 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -8,7 +8,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: encoding.test,v 1.16.2.1 2003/03/27 21:46:32 msofer Exp $ +# RCS: @(#) $Id: encoding.test,v 1.16.2.2 2004/05/27 14:33:20 rmax Exp $ package require tcltest 2 namespace import -force ::tcltest::* @@ -291,6 +291,21 @@ test encoding-15.1 {UtfToUtfProc} { encoding convertto utf-8 \xa3 } "\xc2\xa3" +test encoding-15.2 {UtfToUtfProc null character output} { + set x \u0000 + set y [encoding convertto utf-8 \u0000] + set y [encoding convertfrom identity $y] + binary scan $y H* z + list [string bytelength $x] [string bytelength $y] $z +} {2 1 00} + +test encoding-15.3 {UtfToUtfProc null character input} { + set x [encoding convertfrom identity \x00] + set y [encoding convertfrom utf-8 $x] + binary scan [encoding convertto identity $y] H* z + list [string bytelength $x] [string bytelength $y] $z +} {1 2 c080} + test encoding-16.1 {UnicodeToUtfProc} { encoding convertfrom unicode NN } "\u4e4e" |
