Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitcoin QR code generation issue #1

Closed
Wikinaut opened this issue Nov 13, 2015 · 2 comments
Closed

Bitcoin QR code generation issue #1

Wikinaut opened this issue Nov 13, 2015 · 2 comments

Comments

@Wikinaut
Copy link

When you generate with http://www.jsqr.de (text mode) bitcoin:1JSQRqsGniGHejkntZv5JkoFdMj8MPuyHu this is not correctly encoded, a common bitcoin wallet fails to decode the QR code.

However, when generating with ZXing online generator, it works.
https://zxing.appspot.com/generator/

https://zxing.org/w/chart?cht=qr&chs=350x350&chld=L&choe=UTF-8&chl=bitcoin%3A1JSQRqsGniGHejkntZv5JkoFdMj8MPuyHu

@jens-duttke
Copy link
Owner

Thanks for reporting this issue.

The encoder on http://www.jsqr.de/encode.html encodes the data always using the encoding mode UTF8_SIGNATURE, which adds a Byte Order Mark to the beginning of the string, to tell the decoder, how to interprete the data, even if there are no UTF-8 encoded characters in the string.

Seems like neither the decoder you've used, nor the ZXing online generator support Byte Order Marks, so they both work together.

Anyhow, since in your specific case, your string does not include any UTF-8 characters, it's not required to add a BOM to the string.

So, I've implemented a detection, which checks the used characters, and use the BYTE encoding method instead of UTF8_SIGNATURE, if the string does not contain UTF-8 characters.

Beside that, I've implemented a new encoding option for Bitcoins:
http://www.jsqr.de/encode-bitcoin.html

Can you please check that with your bitcoin wallet software again?

@Wikinaut
Copy link
Author

Yep, confirmed, it works.
I now used this test (with Umlauts!)

bitcoin:1JSQRqsGniGHejkntZv5JkoFdMj8MPuyHu?label=test1%20Test2äöüß&amount=0.10

and it works with your new page.

BTW, I use this https://play.google.com/store/apps/details?id=de.schildbach.wallet&hl=de bitcoin wallet, source code is also on Github.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants