foxitsoftware / DelphiZXingQRCode

Delphi port of QR Code functionality from ZXing, a barcode image processing library.
Apache License 2.0
197 stars 115 forks source link

Bug at encode alphanumeric strings with 0 (zero) #10

Closed mathesoft closed 6 years ago

mathesoft commented 6 years ago

https://github.com/foxitsoftware/DelphiZXingQRCode/blob/7753eb6d4924b1d5cc97fcc179a85362db688995/Source/DelphiZXIngQRCode.pas#L1051

In this line it is need to set > 0; to >= 0; (or > -1;).

Reason: GetAlphanumericCode give back for '0' the value 0 from ALPHANUMERIC_TABLE (defined Line 66).

If you want with actual sourcecode to encode a string like '00.00.00.00' the QR will only ecnode '...' (three dots without the zeros).

With bugfix it encodes correct '00.00.00.00'. I found that because I tried to encode the IP 192.168.165.101 and the result string was every time 192.168.165.11 - missing the 0...

mathesoft commented 6 years ago

Oh, I'm new on github; beginner mistake - it was solved 2015 at 'pull requests'-tab. But why nobody update the file for download?