diff --git a/src/main/java/com/solab/iso8583/IsoMessage.java b/src/main/java/com/solab/iso8583/IsoMessage.java index 062c0a7..90c3d89 100644 --- a/src/main/java/com/solab/iso8583/IsoMessage.java +++ b/src/main/java/com/solab/iso8583/IsoMessage.java @@ -355,7 +355,7 @@ public class IsoMessage { for (int i : idx) { IsoValue v = src.getField(i); if (v != null) { - setValue(i, v.getValue(), v.getType(), v.getLength()); + setValue(i, v.getValue(), v.getEncoder(), v.getType(), v.getLength()); } } } diff --git a/src/main/java/com/solab/iso8583/IsoValue.java b/src/main/java/com/solab/iso8583/IsoValue.java index add7791..687d971 100644 --- a/src/main/java/com/solab/iso8583/IsoValue.java +++ b/src/main/java/com/solab/iso8583/IsoValue.java @@ -177,6 +177,11 @@ public class IsoValue implements Cloneable { return value == null ? 0 : toString().hashCode(); } + /** Returns the CustomField encoder for this value. */ + public CustomField getEncoder() { + return encoder; + } + /** Writes the formatted value to a stream, with the length header * if it's a variable length type. */ public void write(OutputStream outs, boolean binary) throws IOException {