If you really need to convert to UTF-8 (and I would try IlyaM's suggestion first) , you might be interested in the Encode module. It's in the 5.8.0 distribution.

from the manpage:

$string = decode(ENCODING, $octets [, CHECK]) Decodes a sequence of octets assumed to be in ENCODING into Perl's internal form and returns the resulting string. As in encode(), ENCODING can be either a canon- ical name or an alias. For encoding names and aliases, see "Defining Aliases". For CHECK, see "Handling Mal- formed Data".

I've only played with this a little, but 5.8 (5.8.0 RC2 that is) seems to be a lot more stable when you use utf8; so it might be your best best.

-- Joost downtime n. The period during which a system is error-free and immune from user input.

In reply to Re: Generating UTF-8 from nasty high ASCII input by Joost
in thread Generating UTF-8 from nasty high ASCII input by samtregar

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.