develooper Front page | perl.perl5.porters | Postings from May 2003

[perl #22375] 'split'/'index' problem for utf8

From:
Daniel Yacob
Date:
May 29, 2003 15:28
Subject:
[perl #22375] 'split'/'index' problem for utf8
Message ID:
rt-22375-58367.3.11825762018046@rt.perl.org
# New Ticket Created by  Daniel Yacob 
# Please include the string:  [perl #22375]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=22375 >


Greetings,

I've found a really odd behavior either with split or index,
I'm not really sure which.  The script below will demonstrate
the problem.  In short index is not returning the right value
when a string reference is used vs a constant string (that is
$string vs "abcde").  It appears that the sequence that chars
where in before they were split effects the outcome.  The chars
are used as the substring argument of split.

Its really weird and unfortunately also blocking a real world
problem.

thanks,

/Daniel

I'm using Perl 5.8.0 on a Redhat 8 Linux:


begin 775 split-utf-break.pl.gz
M'XL("#"$UCX``W-P;&ET+75T9BUB<F5A:RYP;`#%4L%.XS`4/..O>*252J5"
M1)$J1+>PA^6P%T[<6!2Y[0NQUK4C^X52K;C3/^'87^J?\.PTI>U>N!'Y$(_'
M,_,F:1VGE7?I6)FT1*?A="XJCU!1?CF,;YZ<FM!0B-D"V@9QJA%&D*S?5NOE
M*AD&^&<->\9]J17!":1I;\ON\N72*4.0W*,G99[@Q^;L^G3G^6-JN78A%Y[D
MY"^,V.8]KHU9;AW*2<$&6\\N_!-'&WF`AW;V"*-K2'J@S!1?F+FOP;$RZ/:8
M.^(I>N*HH6U=/QDW,=&K$"W1`H<E2H)Q14!.&E]:+H<*A,V4&HG0>>;NMK1<
ML2^+?*$BE==A5PE+-B?^X?QQ;\0.$SJ!T-EA=(Z;I%_N^7N:S++;NU]9)L0]
M%Y=;K>T\Q%0^-FDK*D.]!??\&SSB%1.;26K7O4$$IV0XQNR'%'VXB=BRQBX"
M=L'8ITC\'O^+'%XX%!XP)L2=):S3A;1:>H)GJ2L,^24D@P2DF8*Q%'9]WGG`
MEQ(GA-.S.''I[%CC#)XLURWG<@'S`DU4RY5CN?HG@MS9642;)@4[.)S9YZ#T
)`6"B()NS`P``
`
end





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