I'm working on the
SCJD assignment and it states that the data in my database file is "8 bit US ASCII". They also imply that DataInputStream is my class of choice for parsing the data.
Anyway, I receive the data via a DataInputStream as a byte array and transform it into a
String. Can I just get away with:
String s = new String(myByteArray); ???
Alternatively, I can also use
String s = new String(myByteArray, [encoding]);
but the closest available encodings according to the 1.5 JavaDocs are US-ASCII (which is 7-bit ASCII) or UTF-8. Is UTF-8 the same as "8 bit US ASCII"? Or can I just say that 8-bit ASCII will translate to unicode without serious issues and just use the first line above?
Am I being too fussy, or is this a legitimate issue?