2019-11-20から1日間の記事一覧

特定の文字がWindows-31J(Shift_JIS)で扱えるかどうかをJavaで確認する。

現時点では、以下のコードが一番よさそう。 private static final Charset windows31J = Charset.forName("Windows-31J"); public boolean canEncodeWithWindows31J(CharSequence str) { CharsetEncoder encoder = windows31J.newEncoder(); return encoder.…