Closed dominiquefournier closed 3 years ago
This looks like an automatically added prefix of your material scanners/software. You should check their configuration.
It is not the case because I just scan an other QRCode and there is no added chars. It was my first reaction too.
Found ! If I use Encoding('ISO-8859-1'), the problem is solved. It was the UTF-8 definition which is 000026.
@endroid is it possible to somehow configure to remove the #000026
prefix? The barcode scanner of our client is unable to scan the QR code because of that prefix.
Hi @weiting-sflx this is called an ECI block and it is necessary to correctly inform the reader that the text is in UTF-8. In other words it is not something that should be removed. If you rely heavily on a reader which is incapable of handling this information you can try changing the encoding to ISO-8859-1
.
Hi @endroid Thanks for the response. We are an international company and encoding ISO-8859-1 is not supported in some languages such as Polish. We tried to use Google API for generating the QR code with the UTF-8 encoding and there is no ECI prefix.
I understand. As far as I can see the underlying library https://github.com/Bacon/BaconQrCode does not provide a toggle for adding this block. Maybe you can look and ask there to see if anything in this direction is possible (maybe using another encoding) or if the author can think of a solution. My library only passes the text and encoding to that library so this is not something I have control over from here.
We forked from the bacon library and your libraries. Will create PRs later.
I just try to generate a QRCode with the following test code :
But two material scanners are reading : "\000026708172c8-4627-4dc1-8b65-7bf33df8b440" If I use my smartphone the result is valid.
Here is the generated QRCode