Open RexWzh opened 1 year ago
A hint is given here:
E4 BD A0 E5 A5 BD is the correct UTF-8 encoded form of "你好". C3 A4 C2 BD C2 A0 C3 A5 C2 A5 C2 BD is what happens when the UTF-8 codeunits are upscaled as-is into UTF-16 codeunits (ie E4 -> E400, BD -> BD00, etc) and then encoded into UTF-8.
A (fragile) workaround:
qrencode 'hello is 你好' -o - | zbarimg --raw -q - | iconv -f utf8 -t utf16le | tr -d '\0'
The executable
zbarimg
doesn't seem to support UTF8 mode. For example, the text "你好" is decoded to be "ä½ å¥½".Also, the
--xml
option has the possibility of encoding garbled characters, when dealing with Kanji mode or special characters in the Byte mode. For example, the text]]>
is decoded to be\nXV0+\n
.Flexible support for encoding rules can be cumbersome. Is there any function (or API) that can return a list of QR code matrices directly? This would provide more flexible operations. Thanks in advance!!