Monks,

I'm building a rss feed with Perl. Despite asking people to paste only text, they often copy and paste from Word or other word processors and I end up with bad characters. I have been switching a lot of characters, but inevitably there is a character I don't catch. There seem to be some bullets that I can't catch and it makes the feed choke. Interestingly, if I print the feed to a flat file it can be opened in a browser even with the bad characters, but if I print it dynamically from Perl the browser shows an error. I guess my first question is why would that be?

Here are a few of the characters I'm switching out. How do I find the binary code for these bullets that are pasted into the form so I can escape them?

$text =~ s/&//gi; $text =~ s/Æ//gi; $text =~ s/ì//gi; $text =~ s/î//gi; $text =~ s/\n//eg; $text =~ s/\r//eg; $text =~ s/í/\'/gi; $text =~ s/-/ /gi; $text =~ s/\x9s/-/gi; $text =~ s/\x96/-/gi; $text =~ s/\x95/\<li\>/gi; $text =~ s/’/'/gi; $text =~ s/\?/?/gi; $text =~ s/0xa0/ /gi;
These are the bullets when copied out of the text, but using this code doesn't work:
$text =~ s/·//g; $text =~ s/o//g;

In reply to Stripping bad characters in rss by htmanning

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.