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

Fix unreadable Shift-JIS encoded QR Code #173

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

askdkc
Copy link
Contributor

@askdkc askdkc commented Mar 21, 2024

This PR is fix for the issue #172

Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (main@c01758c). Click here to learn what that means.

Files Patch % Lines
src/Encoder/Encoder.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #173   +/-   ##
=======================================
  Coverage        ?   64.93%           
  Complexity      ?      980           
=======================================
  Files           ?       48           
  Lines           ?     3094           
  Branches        ?        0           
=======================================
  Hits            ?     2009           
  Misses          ?     1085           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DASPRiD
Copy link
Member

DASPRiD commented Mar 21, 2024

I'm not a big fan of this – the kanji mode exists specifically to massively reduce the amount of storage required for that.

Looking at the original zxing code I noticed that they subtract 1 from the length to make it uneven, which we don't do.

Could you test locally if that makes a difference for your result?

@DASPRiD
Copy link
Member

DASPRiD commented Mar 21, 2024

I also tried to generate the same QR code with ZXing, which yielded a valid QR code, so there must be some bug in Bacon, but I can't tell, which.

QR Code

@askdkc
Copy link
Contributor Author

askdkc commented Mar 21, 2024

@DASPRiD

I tested your suggestion but unfortunately the result is still unreadable QR code.
qrcode

@askdkc
Copy link
Contributor Author

askdkc commented Mar 21, 2024

I also tried to generate the same QR code with ZXing, which yielded a valid QR code, so there must be some bug in Bacon, but I can't tell, which.

@DASPRiD

Could you test with "あいうえお" not "あいうえお123"?

@DASPRiD
Copy link
Member

DASPRiD commented Mar 21, 2024

You can open the link yourself :)

@askdkc
Copy link
Contributor Author

askdkc commented Mar 21, 2024

You can open the link yourself :)

My bad😅 (I thought you are testing it in locally.)

It works with "あいうえお" in ZXing. So yeah, I think something wrong with Bacon but I'm not sure what is.

@DASPRiD
Copy link
Member

DASPRiD commented Mar 21, 2024

I'd recommend to poke around and compare the code paths for kanji between Bacon and ZXing, it might be some very small knob.

@DASPRiD DASPRiD marked this pull request as draft March 22, 2024 19:50
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

Successfully merging this pull request may close these issues.

2 participants