On Sun, Sep 07, 2003 at 02:50:35PM +0000, Peter Gibbs wrote: > # New Ticket Created by Peter Gibbs > # Please include the string: [perl #23752] > # in the subject line of all future correspondence about this issue. > # <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=23752 > > > > The 'index' opcode searches for a substring in another string. It seems > reasonable to expect that equal strings would match at offset zero. But the > program: > ---------------------------------------- > set S0, "\xAB" > find_chartype I0, "8859-1" > set_chartype S0, I0 > find_encoding I0, "singlebyte" > set_encoding S0, I0 > > find_encoding I0, "utf8" > find_chartype I1, "unicode" > transcode S1, S0, I0, I1 > > eq S0, S1, equal > print "not " > equal: > print "equal\n" > > index I0, S0, S1 > print I0 > print "\n" > > end > ---------------------------------------- > yields the output: > ---------------------------------------- > equal > -1 > ---------------------------------------- > which doesn't seem quite right.
Looks like a bug to me, but I'm no expert on where to start searching for it. Nicholas Clark