Converts half-width katakana to their full-width counterparts

Discussion in 'Perl Misc' started by wing328hk@gmail.com, Apr 12, 2006.

  1. Guest

    Hi,

    Does anyone know if there is a function in Perl to convert half-width
    katakana to their full-width
    counterparts?

    I have found that the conversion can be done as shown in
    ftp://ftp.ora.com/pub/examples/nutshell/ujip/perl/unkana.pl, but that
    example is 10 years ago and I'm wondering if there are some new ways to
    do it?

    Thanks,
    Wing
     
    , Apr 12, 2006
    #1
    1. Advertising

  2. Guest Guest

    wrote:

    : I have found that the conversion can be done as shown in
    : ftp://ftp.ora.com/pub/examples/nutshell/ujip/perl/unkana.pl, but that
    : example is 10 years ago and I'm wondering if there are some new ways to
    : do it?

    Not really except for the arrival of Unicode. The script still holds
    valid in a central point: the conversion from two-char half-width kana
    into one-char full-width kana. The ksth rows can be modified by a double-
    dot (dakuten): ka+"=>ga, ke+"=>ge, ..., sa+"=>za, ... ta+"=>da, ... ho+"=>bo.
    You need two (half-width) character cells for expressing one kana, yet
    full-width kana all puts it (i.e. base character and diacritics) into
    one character cell.

    So, you simply add a Unicode table to the program. FW hiragana starts at
    U+3042, katakana at U+30a2.

    But, before I forget, you should have a look at Unicode::Japanese. It seems
    to perform this action, too, but I didn't test it. Another one is Jcode, a
    Japanese charset handler (also untested). There may be more, check CPAN with
    keyword Japanese.

    Oliver.
    --
    Dr. Oliver Corff e-mail: -berlin.de
     
    Guest, Apr 12, 2006
    #2
    1. Advertising

  3. Brad Baxter Guest

    wrote:
    > Hi,
    >
    > Does anyone know if there is a function in Perl to convert half-width
    > katakana to their full-width
    > counterparts?
    >
    > I have found that the conversion can be done as shown in
    > ftp://ftp.ora.com/pub/examples/nutshell/ujip/perl/unkana.pl, but that
    > example is 10 years ago and I'm wondering if there are some new ways to
    > do it?
    >
    > Thanks,
    > Wing


    Perhaps Unicode::Normalize?

    --
    Brad
     
    Brad Baxter, Apr 17, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Samuel R. Neff
    Replies:
    2
    Views:
    593
    bradley
    Jun 10, 2005
  2. trint
    Replies:
    4
    Views:
    705
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Sep 11, 2007
  3. Replies:
    1
    Views:
    173
    Ken Bloom
    May 28, 2007
  4. joe chesak
    Replies:
    7
    Views:
    289
    (r.*n){2}
    Sep 23, 2010
  5. Mike Ballard
    Replies:
    6
    Views:
    272
    Dr.Ruud
    Nov 15, 2005
Loading...

Share This Page