Hi all.

Thanks for the replies.

I guess the problem I have is understanding exactly what it is I'm trying to search for and replace.

The context of this is not quite as simple as parsing html files. The text replacement is actually done by the apache module mod_publisher; my perl script is a mod_rewrite rewritemap script which creates the mod_publisher replacement rules dynamically.

The problem I'm trying to solve is when webpages contain illegal MS Windows characters - I need to replace then with valid HTML chars. The "bad" chars work OK in browsers if the correct font is installed, but when proxying everything through mod_publisher, all content gets converted to utf8 format and the chars don't show up right in the proxied page.

The only way I've got this to work so far is by pasting in the binary character I want to replace.

I guess I'll just leave things as they are for now. Thanks, R.

--

Robin Bowes | http://robinbowes.com


In reply to Re^2: Representing "binary" character in code? by robinbowes
in thread Representing "binary" character in code? by robinbowes

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.