8
$\begingroup$

Bug introduced in 13.2 or 13.3 and fixed in 14.1

Trying to generate a simple QR code with ← or U+2190. I got varying results: the same in Mathematica versions 12.3 and 13.1 but very different in version 13.3.

enter image description here

Mathematica 13.3 was updated to include explicit control for the error correction level. So I tried this code:

Table[BarcodeImage["\[LeftArrow]", {"QR", n}], {n, 0, 8}]

Code results.

These all encode â and when pressing the search link from the stock iOS camera app it adds four ? to the end searching for "â????" in the web. Android sees the first character followed by two unrecognized characters.

I then tried using the following to refer to the desired character:

FromCharacterCode[{8592}, "UTF8"]
FromCharacterCode[{226, 134, 144}, "UTF8"]
"\:2190"
"\|E28690"

Though these do not give different results and the last line is not even a recognized symbol though I believe it should encode the same symbol. I also had similar problems in trying to encode different arrow characters such as ⬅ which encodes as ⬠and adds two ?? when the search link is pressed searching for â¬?? in the web or ⬠followed by a single unrecognized symbol on Android. This is really strange behavior but BarcodeImage[] seems to work fine for most other strings in 13.3. Is this a bug or am I missing something major here?

$\endgroup$
1
  • $\begingroup$ Thanks for the post. That is has been already reported and fixed. Will get rolled out in the next Mathematica versions. $\endgroup$
    – mbaros
    Commented Jan 15 at 14:39

1 Answer 1

9
$\begingroup$

I am not super comfortable with peculiarities of character encodings in Mathematica, but I would say this is a regression bug introduced when they changed the external library used for QR generation (from ZXing Java Library to BarcodeTools.dll). You should report it to the WTS.

As a hacky workaround, you can try using:

fixBarcodeImage[args___] := Internal`InheritedBlock[{ToString},
  Unprotect[ToString];
  ToString[str_, CharacterEncoding -> "UTF-8"] := str;
  BarcodeImage[args]]

fixBarcodeImage["←"]

enter image description here

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.