I needed to do a similar task for pre-Unicode Mongolian to Unicode. The hash provided is only a sample. The full script is at http://students.washington.edu/blanch/downloads/encodingConverter.pl You can drop your hash in and it should run with little modification if any.
#!/usr/local/bin/perl # encodingConverter.pl # Duane L. Blanchard # http://students.washington.edu/blanch/downloads/ # blanch@iname.com use strict; use warnings; #use utf8; use charnames ':full'; #hash tables for each encoding must be at the top #Hash table Keys: Cyrillic Chars, Values: Unicode Char Names my %name = ( # Lowercase "à" => "\N{CYRILLIC SMALL LETTER A}", "á" => "\N{CYRILLIC SMALL LETTER BE}", "â" => "\N{CYRILLIC SMALL LETTER VE}", "ã" => "\N{CYRILLIC SMALL LETTER GHE}", # Uppercase "A" => "\N{CYRILLIC CAPITAL LETTER A}", "Á" => "\N{CYRILLIC CAPITAL LETTER BE}", "Â" => "\N{CYRILLIC CAPITAL LETTER VE}", "Ã" => "\N{CYRILLIC CAPITAL LETTER GHE}", ); # Open the input file my $inFile; until(open(OUTFILE, ">outFile.txt")) { print("\n$inFile could not be found."); } print("What file would you like to convert? \n"); $inFile = <stdin>; #query user for input file chomp $inFile; until(open(inFile, "$inFile")) { print("\n$inFile could not be found.", " Please provide the absolute path. \n"); $inFile = <stdin>; } while (<inFile>) { my $line = $_; # $_ is a line of text my @array = split ("", $line); # $_ is now a character for (@array) { if (exists $name{$_}) # check the hash for $_ { print OUTFILE $name{$_}; # print the Unicode value of $_ } else { print OUTFILE "$_"; # preserves English } } } close OUTFILE; print "\nYour converted text is in:\n", ">> outFile.txt.\n\n";

In reply to Re: Orthography Translation using Regex by Anonymous Monk
in thread Orthography Translation using Regex by Baz

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.