Merge pull request #387 from jawallace/hex_viewer

Fix string out of bounds exception on non-windows.
This commit is contained in:
Brian Carrier 2013-12-09 10:27:08 -08:00
commit 40e55a4f64

View File

@ -102,10 +102,10 @@ public class DataConversion {
outputStringBuilder.append(" ");
// print the ascii columns
String ascii = new String(array, curOffset, lineLen);
String ascii = new String(array, curOffset, lineLen, java.nio.charset.StandardCharsets.US_ASCII);
for (int i = 0; i < 16; i++) {
char c = ' ';
if (i < lineLen) {
if (i < ascii.length()) {
c = ascii.charAt(i);
int dec = (int) c;