In a somewhat related vein, if you want to remove some of the special characters that MSword creates you can use the following code which is based on the excellent
demoronizer
code.
sub nukeMSsmarts {
my $s = shift;
# Map incompatible CP-1252 characters
$s =~ s/\x82/,/g;
$s =~ s-\x83-<em>f</em>-g;
$s =~ s/\x84/,,/g;
$s =~ s/\x85/.../g;
$s =~ s/\x88/^/g;
$s =~ s-\x89- °/°°-g;
$s =~ s/\x8B/</g;
$s =~ s/\x8C/Oe/g;
$s =~ s/\x91/'/g;
$s =~ s/\x92/'/g;
$s =~ s/\x93/"/g;
$s =~ s/\x94/"/g;
$s =~ s/\x95/*/g;
$s =~ s/\x96/-/g;
$s =~ s/\x97/--/g;
$s =~ s-\x98-<sup>~</sup>-g;
$s =~ s-\x99-<sup>TM</sup>-g;
$s =~ s/\x9B/>/g;
$s =~ s/\x9C/oe/g;
# Now check for any remaining untranslated characters.
$s =~ s/[\x00-\x08\x10-\x1F\x80-\x9F]/*/g;
return $s;
}
-------------------------------------
Nothing is too wonderful to be true
-- Michael Faraday
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|