Light-weight utilities that make your life easier when dealing with Japanese text.
Quickly process text containing kana characters with just a few lines of code.
Get Latest Stable Release
GitHub Repository
Download JAR
import com.mariten.kanatools.KanaConverter;
String input_str = "テスティング 1−2−3";
// Set the desired conversion flags
int conv_op_flags = 0;
conv_op_flags |= KanaConverter.OP_HAN_KATA_TO_ZEN_KATA;
conv_op_flags |= KanaConverter.OP_ZEN_ASCII_TO_HAN_ASCII;
// Convert the string
String output_str = KanaConverter.convertKana(input_str, conv_op_flags);
// Compare result
System.out.println("Before: " + input_str);
System.out.println("After: " + output_str);
Before: テスティング 1−2−3
After: テスティング 1-2-3