public class Test {
public static void main(String[] args) throws Exception{
String str = "あ";
System.out.println(str.getBytes("UTF-8").length);
System.out.println(str.getBytes("Shift-JIS").length);
System.out.println(str.getBytes("MS932").length);
System.out.println(str.getBytes("EUC-JP").length);
}
}
実行結果は以下のようになります。3 2 2 2