package sjisLength; import java.io.UnsupportedEncodingException; public class SJISLength { public int getStrLen1(String str) { try { return str.getBytes("MS932").length; } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return -1; } public int getStrLen2(String str) { int len = 0; int cp; for(int idx=0; idx 65535) idx++; } return len; } }