Here's is rough sketch of how you might go about doing it:

# your sample string my $orig = "\x{2be}\x{e0}-da-um-=T\x{da}G-:2 1 AKTUM-=T\x{da}G"; my $s = $orig; $s =~ s/(\p{Ll}+)/<i>$1<\/i>/g; # lower --> italic $s =~ s/(\p{Lu}+)/lc($1)/ge; # upper --> lower open my $fh, ">:utf8", "sample.html" or die $!; print $fh qq|<html> <header> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </header> <body> $orig<br /> $s </body> </html> |; close $fh;

Then load the sample.html in your browser; the second line should be the modified string.  Except for the ʾ, it appears to work. I'm not sure what the ʾ (\x{2be}) is. It doesn't seem to be treated as a lowercase character (the Unicode database lists it among "spacing modifying letters")... I'm afraid you'll have to figure that one out yourself :)


In reply to Re^2: formatting my html output by almut
in thread formatting my html output by frasco

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.