I'm creating a page to output rtf formatted files from a database, which requires some reformatting of html and UBBC. What I can't get it to do is convert <br /> etc into \par, without it producing \'08 or \'05 or \'02 etc.

Some examples:

Without switching anything, I get

{\pard \fs20 I drive from east hull to grimston bar\'2e Would anyone be interested in a car share? Also I could collect / drop off along the A1079\'2e

Outward journeys depart Hull approx 06:45

Return journeys depart York approx 17:30 to 18:00 Monday, Tuesday and 16:30 the rest of the week\'2e

\par}

Using $message =~ s~<br />~\par~ig; Gets

{\pard \fs20 I drive from east hull to grimston bar\'2e Would anyone be interested in a car share? Also I could collect / drop off along the A1079\'2eparparOutward journeys depart Hull approx 06:45parparReturn journeys depart York approx 17:30 to 18:00 Monday, Tuesday and 16:30 the rest of the week\'2e par par \par}

using $message =~ s~<br />~\\par~ig; produces

{\pard \fs20 I drive from east hull to grimston bar\'2e Would anyone be interested in a car share? Also I could collect / drop off along the A1079\'2e\'5cpar\'5cparOutward journeys depart Hull approx 06:45\'5cpar\'5cparReturn journeys depart York approx 17:30 to 18:00 Monday, Tuesday and 16:30 the rest of the week\'2e \'5cpar \'5cpar \par}

Am I missing something very obvious here?


In reply to Formatting rtf - problems by s_m_b

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.