check if encoding has been set before using it

This commit is contained in:
Enrique Zamudio
2013-11-27 12:23:51 -06:00
parent 3e714d3409
commit 2c3d3e8a6d
@@ -262,7 +262,7 @@ public class IsoValue<T> implements Cloneable {
} else if (ldiff == 2) { } else if (ldiff == 2) {
lhead = "00" + lhead; lhead = "00" + lhead;
} }
outs.write(lhead.getBytes(encoding)); outs.write(encoding == null ? lhead.getBytes():lhead.getBytes(encoding));
} else { } else {
//write the length in ASCII //write the length in ASCII
if (digits == 3) { if (digits == 3) {