From: SourceForge.net <no...@so...> - 2009-06-11 14:55:20
|
Bugs item #2804024, was opened at 2009-06-10 11:11 Message generated for change (Comment added) made by sucotronic You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=615504&aid=2804024&group_id=96670 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: Accepted Priority: 5 Private: No Submitted By: sucotronic (sucotronic) Assigned to: Nobody/Anonymous (nobody) Summary: PDF417 control character bad encoded Initial Comment: When I try to generate a barcode with this statement: bean.generateBarcode(provider,(char)29+(char)29+(char)29+(char)29+(char)29+"B"); and then try to read the result, I get the following: "145B" Is it a bug o a encoding missmatching? ---------------------------------------------------------------------- >Comment By: sucotronic (sucotronic) Date: 2009-06-11 16:55 Message: Thanks. I've also downloaded your cvs code and trying to find the bug.. ---------------------------------------------------------------------- Comment By: Jeremias Mrki (jmaerki) Date: 2009-06-11 15:01 Message: Ok, that latest example indeed seems to trigger a bug. I'll look at it as soon as I can. No promises for a timely fix. I'm quite busy at the moment. "5789\u001dB0KLT3215\u001e\u0004"; //good "45789\u001dB0KLT3215\u001e\u0004"; //bad ---------------------------------------------------------------------- Comment By: sucotronic (sucotronic) Date: 2009-06-11 13:00 Message: Ups, I press accidentally the button... Well, as you can see in previous comment the read data doesn't correspond with the given string. I'm still thinking is something related with encoding. ---------------------------------------------------------------------- Comment By: sucotronic (sucotronic) Date: 2009-06-11 12:58 Message: Ok. I've done another test with this: ... kk ="[)>\u001e06\u001d1JUN123456789A2B4C6D8E\u001dP12345678\u001dQ50\u001d2SB0345789\u001dB0KLT3215\u001e\u0004"; bean.generateBarcode(provider,kk); ... And the result read is: (text): [)>#06#1JUN123456789A2B4C6D8E#P12345678#Q50#2SB0345789#1A&#/DCBF## (hex): 5b 29 3e 1e 30 36 1d 31 4a 55 4e 31 32 33 34 35 36 37 38 39 41 32 42 34 43 36 44 38 45 1d 50 31 32 33 34 35 36 37 38 1d 51 35 30 1d 32 53 42 30 33 34 35 37 38 39 1d 31 41 26 0d 2f 44 43 42 46 1e 04 ---------------------------------------------------------------------- Comment By: Jeremias Mrki (jmaerki) Date: 2009-06-11 11:40 Message: It's a Java mistake on your side. "char" in Java is an unsigned number. Until the "B" the Java compiler thinks you want to sum up numbers: 5*29 = 145. It essentially adds the 5 numbers together and then converts that sum to a string (Integer.toString). You have to do either: "\u001D\u001D\u001D\u001D\u001DB" or ""+(char)29+(char)29+(char)29+(char)29+(char)29+"B" ---------------------------------------------------------------------- Comment By: sucotronic (sucotronic) Date: 2009-06-10 13:21 Message: I've just downloaded and build the latest version from cvs and the problem remains. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=615504&aid=2804024&group_id=96670 |