(1)使用
ICU4J
String src = "AaAアいろはアイウエイウエ";
//全角文字→半角文字に変換
Transliterator trF2H = Transliterator.getInstance("Fullwidth-Halfwidth");
System.out.println(src + "→★(全角文字→半角文字)★→" + trF2H.transliterate(src));
//半角文字→全角文字に変換
Transliterator trH2F = Transliterator.getInstance("Halfwidth-Fullwidth");
System.out.println(src + "→★(半角文字→全角文字)★→" + trH2F.transliterate(src));
//カタカナ→ひらがなに変換
Transliterator trK2H = Transliterator.getInstance("Katakana-Hiragana");
System.out.println(src + "→★(カタカナ→ひらがな)★→" + trK2H.transliterate(src));
//ひらがな→カタカナ変換
Transliterator trH2K = Transliterator.getInstance("Hiragana-Katakana");
System.out.println(src + "→★(ひらがな→カタカナ)★→" + trH2K.transliterate(src))