In Java, I have a String and I want to encode it as a byte array (in UTF8, or some other encoding). Alternately, I have a byte array (in some known encoding) and I want to c
Charset UTF8_CHARSET = Charset.forName("UTF-8"); String strISO = "{\"name\":\"א\"}"; System.out.println(strISO); byte[] b = strISO.getBytes(); for (byte c: b) { System.out.print("[" + c + "]"); } String str = new String(b, UTF8_CHARSET); System.out.println(str);