src/share/classes/sun/misc/CharacterDecoder.java

Print this page
rev 9696 : 8039474: sun.misc.CharacterDecoder.decodeBuffer should use getBytes(iso8859-1)
Summary: Specify ISO-8859-1 as charset of String to decode.
Reviewed-by: TBD

*** 182,192 **** * Alternate decode interface that takes a String containing the encoded * buffer and returns a byte array containing the data. * @exception CEFormatException An error has occurred while decoding */ public byte[] decodeBuffer(String inputString) throws IOException { ! byte inputBuffer[] = inputString.getBytes(); ByteArrayInputStream inStream = new ByteArrayInputStream(inputBuffer); ByteArrayOutputStream outStream = new ByteArrayOutputStream(); decodeBuffer(inStream, outStream); return outStream.toByteArray(); } --- 182,192 ---- * Alternate decode interface that takes a String containing the encoded * buffer and returns a byte array containing the data. * @exception CEFormatException An error has occurred while decoding */ public byte[] decodeBuffer(String inputString) throws IOException { ! byte inputBuffer[] = inputString.getBytes("8859_1"); ByteArrayInputStream inStream = new ByteArrayInputStream(inputBuffer); ByteArrayOutputStream outStream = new ByteArrayOutputStream(); decodeBuffer(inStream, outStream); return outStream.toByteArray(); }