The
^@ suggests that the offending character is a null character; that is,
all bits are off.
But even though NUL characters present a rather unusual case for regular expressions, it's
not the case that
all bets are off, because you can get rid of null characters in a string thus:
Code:
$data99=~s/\000//g;
So if my guess is right, that will get rid of the symptom.
You can check whether my guess is right by running this Perl fragment on your string (before removing the NUL character):
Code:
@up=unpack("C*",$troublesome_string);
for($jndex=0;
$jndex<0+@up;
$jndex++
)
{
print(sprintf("%02X",$up[$jndex]));
if(($up[$jndex]>=0x20) &&
($up[$jndex]<=0x7E)
)
{
printf(sprintf(" %c",$up[$jndex]));
}
printf("\n");
}
... and you may want to do that, because I'm sure that this code is important enough to you not only to get rid of the symptom, but remove the underlying cause of the problem. Otherwise, that problem may come back to bite you in worse ways than just showing a quirky character on the browser's screen.
Hope this helps.