Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 5529
Status: resolved
Worked: 2.3 hours (140 min)
Priority: 0/
Queue: Tk

People
Owner: Nobody in particular
Requestors: slaven [...] rezic.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 804.025_beta15
Fixed in: (no value)



Subject: Usage of substr($utf8_string) may abort
Using the attached script I get: Tcl_GetStringFromObj @ 552 not utf8 SV = PVLV(0x8170b70) at 0x813a028 REFCNT = 1 FLAGS = (PADMY,GMG,SMG,pPOK,UTF8) IV = 0 NV = 0 PV = 0x83ac588 ".rtsrehc\374lB"\0Malformed UTF-8 character (unexpected end of string) at /usr/perl5.8.3/lib/site_perl/5.8.3/i686-linux/Tk.pm line 247. [UTF8 ".rtsrehc\x{2c080000}"] CUR = 11 LEN = 13 MAGIC = 0x83aacf8 MG_VIRTUAL = &PL_vtbl_substr MG_TYPE = PERL_MAGIC_substr(x) TYPE = x TARGOFF = 0 TARGLEN = 11 TARG = 0x8139fa4 SV = PV(0x83642b8) at 0x8139fa4 REFCNT = 2 FLAGS = (POK,pPOK) PV = 0x836e608 ".rtsrehc\374lB"\0 CUR = 11 LEN = 12 Abort (core dumped) Regards, Slaven
use Tk; $mw=tkinit; $bla = ".rtsrehc\374lB"; $c=$mw->Canvas->pack; #$c->createText(100, 100, -text => $bla); # works $c->createText(100, 100, -text => substr($bla,0)); # does not work MainLoop;
Tk _NEEDS_ UTF-8 and sv_utf8_upgrade() is letting it down. This is depressing - looks like Tk is going to have to re-invent an sv_utf8_upgrade of its own. I was hoping to remove check-and-abort code as it is slow, now it looks like the equivalent cost function is here to stay.
Download bug
application/octet-stream 183b

Message body not shown because it is not plain text.

Explict work round for LVPV added to objGlue.c