angelixd has asked for the wisdom of the Perl Monks concerning the following question:
and the regular expression I'm using later on:my %allowed_text_code = ('$\\alpha$' => 'α', '$\\beta$' => 'β', '$\\gamma$' => 'γ', '$\\delta$' => 'δ', '$\\theta$' => 'θ', '$\\pi$' => 'π', '\\degrees' => '°' );
I've only tested the '$\\pi$' tag, and whenever I look at the resulting file, I'm getting a carriage-return character and a script f ('¶ƒ' on OS X, in TextWrangler). On the web, I'm getting '¦Ä'. So does anyone have any idea what the encoding issue is? Ideally, I would like the output file to be in strict ASCII so that this problem doesn't arise, or do I need to escape my values in my regular expression, or what is it I'm missing here?foreach $tex_key (keys %allowed_text_code){ $text =~ s/\Q$tex_key\E/$allowed_text_code{$tex_key}/g; print $text. "\n"; }
|
|---|