Fix a bug in the ASN1OctetString.stringValue(StringBuilder) method when dealing
with strings containing non-ASCII characters. There were two problems:
- The method did not have a return statment after appending the remainder of
the string once it was determined to be non-ASCII.
- The method did not use the UTF-8 character set when decoding the remainder of
the string once it was determined to be non-ASCII.
| | |
| | | } |
| | | else |
| | | { |
| | | buffer.append(new String(value, i, (length-i))); |
| | | String s; |
| | | try |
| | | { |
| | | s = new String(value, i, (length-i), "UTF-8"); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "stringValue", e); |
| | | |
| | | s = new String(value, i, (length-i)); |
| | | } |
| | | |
| | | buffer.append(s); |
| | | return; |
| | | } |
| | | } |
| | | } |