Menu

#1 Problem when using Binary encoding

open
nobody
None
5
2011-01-19
2011-01-19
Anonymous
No

The following c# code, which encodes a simple string using binary format, results in a barcode that contains different data to the source data.

byte[] barcodeData = new byte[84]; //Need the barcode and encryption classes used on the mobile side.
barcodeData = UnicodeEncoding.GetEncoding(1252).GetBytes("CWCU45679801234567980123456798012345679801234567980123456798012345679801234567980123");
dmImage = new DataMatrix(barcodeData, 36, 36, EncodingType.Binary);
barcodeImage = new Bitmap(DMImgUtility.SimpleResizeBmp(dmImage.Image, 5, 15));

CWCU45679801234567980123456798012345679801234567980123456798012345679801234567980123 - Source Data
CWCU4567980123456798012345679801234567980123456798P3456798012345679801234567980123 - Scanned Data

Lots of other data shows similar problems with binary encoding, but this is a nice simple example where the corruption can be easily seen.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB