From 4e9a61da4ebdae3218ba32738cc6422743a9ae33 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Sat, 21 Feb 2009 10:22:57 +0000 Subject: [Bug 2546087] Restore support for NULs in console stdout channel. In 2004 a fix to Tcl channels prevented the exposure of the internal UTF-8 representation of the ASCII NUL character (\uc080). Since then strings in the console have been truncated at NUL. This restores the older behaviour. --- ChangeLog | 7 +++++++ library/console.tcl | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a95d58e..44a05fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-02-21 Pat Thoyts + + * library/console.tcl: [Bug 2546087] In 2004 a fix to Tcl channels + prevented the exposure of the internal UTF-8 representation of the + ASCII NUL character (\uc080). Since then strings in the console + have been truncated at NUL. This restores the older behaviour. + 2009-02-17 Jeff Hobbs * win/tcl.m4, win/configure: Check if cl groks _WIN64 already to diff --git a/library/console.tcl b/library/console.tcl index 7f39ec3..2f009f0 100644 --- a/library/console.tcl +++ b/library/console.tcl @@ -4,7 +4,7 @@ # can be used by non-unix systems that do not have built-in support # for shells. # -# RCS: @(#) $Id: console.tcl,v 1.40 2009/01/30 21:02:13 patthoyts Exp $ +# RCS: @(#) $Id: console.tcl,v 1.41 2009/02/21 10:22:58 patthoyts Exp $ # # Copyright (c) 1995-1997 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. @@ -663,7 +663,7 @@ proc ::tk::ConsoleInsert {w s} { proc ::tk::ConsoleOutput {dest string} { set w .console - $w insert output $string $dest + $w insert output [string map {\0 \u25a1} $string] $dest ::tk::console::ConstrainBuffer $w $::tk::console::maxLines $w see insert } -- cgit v0.12