I'm replacing "bad" characters in HTML files.
An example of the sort of characters that I'm replacing is:
Ÿ (Not sure how that will come out - it appears as a square box in my source file but appears to get converted to on here)
I've got it in my code as:
However, I'd really like to be able to produce the from "string" programatically, i.e. represent it using pure ascii character.from => qq{Ÿ}, to => q{Ÿ},
I've hex-dumped the source file and the thing between the {} appears as:
i.e. the character is represented by the c2 9f hex digits.000018c0 20 20 46 72 6f 6d 20 20 3d 3e 20 71 71 7b c2 9f | From = +> qq{..|
If I do a test script, and do something like:
And pipe the output to hexdump, I see that $teststring has 4 characters:binmode(STDOUT, ":utf8"); my $teststring = qq{Ÿ}; print "$teststring\n";
So, how do I produce a data structure that holds exactly the same content as "from => qq{}" without having the binary character in my source code?c3 82 c2 9f
Thanks for any help. R.
--
Robin Bowes | http://robinbowes.com
In reply to Representing "binary" character in code? by robinbowes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |