Added a new property, characterEncoding, to MessageFactory, IsoMessage, FieldParseInfo and IsoValue. This helps in parsing messages from byte buffers containing extended characters in encodings other than the default for the JVM. Tested with UTF8 on a Mac (which has default Mac OS Roman) and worked fine.

Several methods now have an additional encoding parameter (just a String, not directly a Charset), but the default is always the JVM's default encoding (taken from the property 'file.encoding').


git-svn-id: https://j8583.svn.sourceforge.net/svnroot/j8583/j8583@70 db60a039-f72e-0410-b1d2-baa000846441
This commit is contained in:
chochos
2011-03-21 23:22:58 +00:00
parent c7d696acc7
commit 5c4259eba3
15 changed files with 153 additions and 56 deletions
@@ -47,7 +47,7 @@ public class LlbinParseInfo extends FieldParseInfo {
throw new ParseException(String.format("Invalid LLBIN length %d pos %d", length, pos), pos);
}
if (pos+2 > buf.length || length+pos+2 > buf.length) {
throw new ParseException(String.format("Insufficient data for LLBIN field, pos %d", pos), pos);
throw new ParseException(String.format("Insufficient data for LLBIN field, pos %d (LEN states '%s')", pos, new String(buf, pos, 2)), pos);
}
byte[] binval = length == 0 ? new byte[0] : HexCodec.hexDecode(new String(buf, pos + 2, length));
if (custom == null) {