Subject: | Bug: incorrect handling of non-ASCII strings |
Date: | Thu, 04 Dec 2008 01:39:58 +0500 |
To: | bug-Tk [...] rt.cpan.org |
From: | Alexander Krasnorutsky <krasnoroot [...] mail.ru> |
Hello!
I think that I have found a bug which may be illustrated by the
following code:
#===========================
use Tk;
$m = new MainWindow;
$s = "\x90";
$b = $m->Label->pack;
$s =~ /(.)/;
$b->configure(-text, $1);
MainLoop
#===========================
Output:
=====================================
Tcl_GetStringFromObj @ 561 not utf8
SV = PVMG(0x857ac18) at 0x85aebbc
REFCNT = 4
FLAGS = (GMG,SMG,READONLY,pPOK)
IV = 0
NV = 0
PV = 0x883a688 "\220"\0
CUR = 1
LEN = 3
MAGIC = 0x85afbe0
MG_VIRTUAL = &PL_vtbl_sv
MG_TYPE = PERL_MAGIC_sv(\0)
MG_OBJ = 0x85aebb0
MG_LEN = 1
MG_PTR = 0x85afc00 "1"
Aborted
======================================
Such code works fine if $s character code is less than 0x80.
Tk 804.028; perl 5.8.6
======================================
Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS
USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Built under linux
======================================
Regards
--
Alexander Krasnorutsky.