import java.nio.charset.Charset;

public class Main {
    public static void main(String[] args) {
        //Windows-31j is a double byte character set, 0x817C decodes to U+ff0D (full-width hyphen)
        Charset ms932 = Charset.forName("Windows-31j");
        byte[] msBytes = new byte[]{(byte) 0x81, (byte) 0x7C};

        String s1 = new String(msBytes, ms932);
        String expected = "\uff0D";

        System.out.println("Windows-31j=>Expected: " + expected + "; Actual: " + s1); //works as expected

        //IBM930 is a double byte character set, 0x4260 should decode to U+ff0D (full-width hyphen)
        Charset ibmCharset = Charset.forName("x-IBM930");
        byte[] ibmBytes = new byte[]{(byte) 0x0e, (byte) 0x42, (byte) 0x60, (byte) 0x0f};

        String s2 = new String(ibmBytes, ibmCharset);
        System.out.println("x-IBM930=>Expected: " + expected + "; Actual: " + s2); //does not work as expected, actual is \u2212
    }
}