I'm dealing with import data from a Mac that has non-ascii apostrophes that
are hex d5. I wrote a regular expression in perl to replace them:
my $hex = 0xd5;
$str =~ s/$hex/\'/g;
OK, now if I make a string in perl with this character in it like so:
my $str = 'foo' . 0xd5 . 's string';
The above regular expression matches. If I run it on a string containing
the character from my input file, it doesn't match.
One thing I noticed was when I had perl print the values, the string I made
in perl printed like so:
foo213s string
While the one from the input file looked like this:
foo�s string
That seems to be the key to the puzzle-- What's the difference between the
two characters in perl?
Someone suggested that I turn on binmode for the file, but it didn't help.
Can anyone explain what the heck is going on here?
Thanks,
Peter Beardsley
Appropriate Solutions, Inc.
pbeardsley[AT]appropriatesolutions.com
*****************************************************************
To unsubscribe from this list, send mail to [EMAIL PROTECTED]
with the text 'unsubscribe gnhlug' in the message body.
*****************************************************************