Hi all, I've looked at this topic . I'm trying to convert smart quotes and other "dumb" characters to standard ASCII characters; what I've found, including this topic here, haven't worked.

demoroniser seems to recognize the single smart quote as three separate characters, and makes the 3rd one a <SUP> element.

If you look at this page you'll see the problematic single quote in the What's New string. I can't seem to search on it with a regex or \x92 or one of those... I would like to find and replace all such miscreant characters. Running Tidy converts it to three character entities... I haven't seen a bit of code that works.

Any suggestions would be most appreciated, as always.

UPDATE: also tried HTML::Entities:

encode_entities($b);

result:

What&acirc;&#128;&#153;s

and ord() might work if I could properly search on it...

Scott


In reply to converting smart quotes by slugger415

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.