I tested the Perl script on hiragana text in Unicode Normalization Form D as well as in Normalization Form C. It doesn't handle NFD properly.

For this input…

NFC どらいどまんごす
NFD どらいどまんごす

…it generates this output…

NFC doraidomangosu
NFD to゙raito゙manko゙su

…which isn't right. The module Lingua::JA::Moji isn't accounting for the possibility of Japanese kana in their decomposed form (NFD).

This may not matter to you for your application, but I felt it was worth pointing out to you in any case. If it does matter to you, then you might suggest to the author of Lingua::JA::Moji that he use the core module Unicode::Normalize to normalize the characters to NFC prior to converting them from kana to romaji.

Normalization Form C (NFC)

U+3069 HIRAGANA LETTER DO U+3089 HIRAGANA LETTER RA U+3044 HIRAGANA LETTER I U+3069 HIRAGANA LETTER DO U+307E HIRAGANA LETTER MA U+3093 HIRAGANA LETTER N U+3054 HIRAGANA LETTER GO U+3059 HIRAGANA LETTER SU

Normalization Form D (NFD)

U+3068 HIRAGANA LETTER TO U+3099 COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK U+3089 HIRAGANA LETTER RA U+3044 HIRAGANA LETTER I U+3068 HIRAGANA LETTER TO U+3099 COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK U+307E HIRAGANA LETTER MA U+3093 HIRAGANA LETTER N U+3053 HIRAGANA LETTER KO U+3099 COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK U+3059 HIRAGANA LETTER SU

In reply to Re: UTF8 issues by Jim
in thread UTF8 issues by kemuri

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.