summaryrefslogtreecommitdiffstats
path: root/tests/encoding.test
diff options
context:
space:
mode:
authorrmax <rmax>2004-05-27 14:33:17 (GMT)
committerrmax <rmax>2004-05-27 14:33:17 (GMT)
commit745b7fd7ab8c61fc34586c00f4cb09945292c3ea (patch)
tree6e898823663aba6bffb15a7c24b317772aa4b0ec /tests/encoding.test
parent9cefb7f497fab0c1e5c76c1ec4f51587c0889eb9 (diff)
downloadtcl-745b7fd7ab8c61fc34586c00f4cb09945292c3ea.zip
tcl-745b7fd7ab8c61fc34586c00f4cb09945292c3ea.tar.gz
tcl-745b7fd7ab8c61fc34586c00f4cb09945292c3ea.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.test17
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"