SimpleSoftwareIO / simple-qrcode

An easy-to-use PHP QrCode generator with first-party support for Laravel.
https://www.simplesoftware.io/simple-qrcode
MIT License
2.7k stars 374 forks source link

Not correct QR Code #5

Closed itorgov closed 9 years ago

itorgov commented 9 years ago

Hello! I tried generate QR Code using your library. That is my code:

<img src="data:image/png;base64, {{ base64_encode(QrCode::format('png')->size(200)->encoding('UTF-8')->errorCorrection('H')->generate("Hello World!")); }}">

But I got incorrect QR Code, I attach them. Generated QR Sorry for my bad English :-)

itorgov commented 9 years ago

That is true QR for "Hello World":

Hello World

SimplyCorey commented 9 years ago

Both of these QrCodes are correct. The first one is encoded using the "High" error correction while the second one is encoding using the "Medium" error correction. They both scan correctly. I have confirmed this by scanning them with a QrCode reader.

There are also many different methods to generate a QrCode. Simple-QrCode uses the ZXing library implementation to create QrCodes. You can read more about this here: http://stackoverflow.com/a/4551192

What encoding is the second QrCode using? Where did you get the second QrCode? Rest assure both are valid QrCodes :smile:

itorgov commented 9 years ago

Secondary QR code generated using http://qrcoder.ru I use Scan app (http://scan.me) for read QR codes. This app can not read QR which generated using your library :-( But it read QR code which generated using dineshrabara/barcode library. I want use your library, because I like it, but I can not :-(

SimplyCorey commented 9 years ago

I will try that app when I get home and see what us going on. They may not support UTF8.

SimplyCorey commented 9 years ago

I am able to read all of the following QrCodes with that app without any issues. Are you getting an error message? Can you give me a screenshot of your phone when it fails to read? I would also try using a different phone app to scan them. Please try scanning the following QrCodes and let me know if they work.

UTF8 utf8

ISO-8859-5 iso-8859-5

ISO-8859-1 iso-8859-1

UTF-16BE utf-16be

GBK gbk

EUC-KR euc-kr

itorgov commented 9 years ago

This is my investigation - http://youtu.be/jepl5LdMJyw So, Scan app is supporting ISO-8859-1 encoding only. However Barcode app by Cocologics is supporting all this encodings. So, there is no bug in your library :-)

SimplyCorey commented 9 years ago

Glad we were able to figure it out. :smile:

Be aware that ISO 8859-1 does not support most foreign languages or special characters.

If we can help you out with anything else, be sure to let us know.