Skip to content

Instantly share code, notes, and snippets.

@yuchan
Created November 8, 2011 14:56
Show Gist options
  • Save yuchan/1347944 to your computer and use it in GitHub Desktop.
Save yuchan/1347944 to your computer and use it in GitHub Desktop.
#! /usr/bin/env perl
=head
半角カタカナ→全角カタカナ変換を調べたのでメモ
=cut
use strict;
use warnings;
use Encode;
use Encode::JP::H2Z;
open FH, "<hankaku.txt";
my @line = <FH>;
foreach my $line(@line){
Encode::from_to($line, "utf-8", "euc-jp");
Encode::JP::H2Z::h2z(\$line);
Encode::from_to($line, "euc-jp", "utf-8");
print $line, "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment