Changes in PDF417HighLevelEncoder.java. Instead of hard coding CP437, format is extracted from URL. Only data URL changes are there for ISO-8859-1 support.
'getDataEncoding' is added to 'tools/URLUtil.java'
Sorry for taking so long to look at your patch, Arpit. I've taken a look and see two problems. First, you've used functions from Java 6 but Barcode4J is still defined to require only Java 1.4, but that's easy enough to fix. Second, I believe your code doesn't do the right thing. It seems to simply encode the symbol as ISO-8859-1 but the default ECI is Cp437 as per ISO 15438:2001. Barcode4J would have to issue an ECI 000001 to switch to ISO-8859-1. It cannot do that, yet. It's a bit late now so I'm going to stop here, but I'll look into generating the ECI codewords in addition to the enhanced encoding handling later this week.
I've just committed a change (partially based on your patch) that allows to set an alternative encoding that is used to encode Unicode-based messages. In you patch you derived the encoding from the data URL's encoding, but that seems inflexible and I could construct cases that came out wrong. Additionally, it is now possible to enable ECI-generation. If enabled it adds an ECI character set indicator at the beginning of the encoded message. When using the Java Bean approach you can use setEncoding(String) and setECIEnabled(boolean) to control the behaviour. In XML, you can do this: