You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although a recent pull request (#170) fixed encoding errors for Shift-JIS, generating QR codes in Kanji mode still presents issues with readability. For instance, attempting to generate a QR code using only Kanji characters results in an unreadable code.
For Kanji Mode example:
useBaconQrCode\Renderer\ImageRenderer;
useBaconQrCode\Renderer\Image\ImagickImageBackEnd;
useBaconQrCode\Renderer\RendererStyle\RendererStyle;
useBaconQrCode\Writer;
$renderer = newImageRenderer(
newRendererStyle(400),
newImagickImageBackEnd()
);
$writer = newWriter($renderer);
$writer->writeFile("あいうえお", "qrcode-alphanum.png", "SHIFT-JIS"); // Kanji Mode is used
Generated QR code (unreadable)
However, by including alphanumeric characters and switching to Byte mode, a readable QR code can be generated.
Although a recent pull request (#170) fixed encoding errors for Shift-JIS, generating QR codes in Kanji mode still presents issues with readability. For instance, attempting to generate a QR code using only Kanji characters results in an unreadable code.
For Kanji Mode example:
Generated QR code (unreadable)
However, by including alphanumeric characters and switching to Byte mode, a readable QR code can be generated.
For Byte Mode example:
Generated QR code (readable)
How to fix:
I think we should just simply use Byte Mode to generate Shift-JIS encoded QR Code by changing this code:
BaconQrCode/src/Encoder/Encoder.php
Lines 165 to 167 in c01758c
to this:
The text was updated successfully, but these errors were encountered: