ZXing.Net
ZXing.Net copied to clipboard
Binary data support
I can not find the possibility of encoding binary data (byte[] instead string). Encoding data into a string is not a solution, if only because of the use of control characters.
var writer = new DataMatrixWriter();
//writer.encode()
public BitMatrix encode(string contents, BarcodeFormat format, int width, int height, IDictionary<EncodeHintType, object> hints);
public BitMatrix encode(string contents, BarcodeFormat format, int width, int height);
Why only string supported?
I think that is a historical reason. This port is based on the original java version. I have no idea why there was that decision. Perhaps because the first implemented codes don't support binary data (like EAN, UPC, etc.). I think in the past I used ISO8859-1 or ISO8859-15 for string encoding of binary data. As far as I remember it worked for every byte from 0 to 255.
This does not allow the use of the library in industrial solutions.