I do not know the best ways of doing the conversion as Charsets and Character Encoding have always confused me
From the JDK API for String class, I presume we are expected to use the following:
String str = new String (buf, "US-ASCII");
byte[] buf= str.getBytes("US-ASCII");
The CharSet class API also says:
"Every instance of the
Java virtual machine has a default charset, which may or may not be one of the standard charsets. The default charset is determined during virtual-machine startup and typically depends upon the locale and charset being used by the underlying operating system."
How do I find out the default charset used by my JDK?