develooper Front page | perl.perl5.porters | Postings from January 2001

Not OK: perl v5.7.0 +DEVEL8429 substr() with UNICODE symbols

Thread Next
From:
Roca, Ignasi
Date:
January 18, 2001 07:51
Subject:
Not OK: perl v5.7.0 +DEVEL8429 substr() with UNICODE symbols
Message ID:
5930DC161690D2119667009027157547038FB401@madt009a.siemens.es
Following test fails:

$x = "\x{263a}\x{263b}\x{263b}";
print Dump($x);
substr($x, 0, 1) = "\x{2652}";
print Dump($x);
ok 150, length($x) == 3 &&
        $x eq "\x{2652}\x{263b}\x{263c}" &&
        substr($x, 0, 1) eq "\x{2652}" &&
        substr($x, 1, 1) eq "\x{263b}" &&
        substr($x, 2, 1) eq "\x{263c}";


Output of Dump is:
SV = PV(0x815cbac) at 0x814e354
  REFCNT = 14
  FLAGS = (POK,pPOK,UTF8)
  PV = 0x8160cf0 "\342\230\272\342\230\273\342\230\273"\0
  CUR = 9
  LEN = 11
SV = PVIV(0x815ed30) at 0x814e354
  REFCNT = 15
  FLAGS = (POK,OOK,pPOK,UTF8)
  IV = 6  (OFFSET)
  PV = 0x8160cf6 ( "\342\230\272\342\230\273" . ) "\342\231\222"\0
  CUR = 3
  LEN = 5


-- Ignasi Roca


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About