I have about a thousand multipage documents which I need to convert from US English and punctuation to UK English and punctuation. Before I start on a perl script, wanted to see if anyone knows of existing tools to do this? I did browse CPAN but didn't find anything...

I'm starting with utf8 rtf documents which have printer's quotes (i.e., distinct left and right curly quotes) which were retained from an original conversion from MS Word docs. Converting from US to UK punctuation means double quotes become single quotes and some single quotes become double (some apostrophes are retained); but in the conversion I would like to retain distinct left and right quotation marks.

I'm thinking that the end documents should have all print typography (em-dashes, en-dashes, printer quotes) should be converted to character entities. Did find the module for HTML entities.

If there is no existing script to do this (seems like a problem others must have faced before) any thoughts on the right approach/tools/code snippets?

Many thanks Monks of Perl...


In reply to Perl to convert US to UK punctuation/spelling? by freewheel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.