heuer/segno

Creating QR Codes with Multiple Data Modes

Closed this issue · 2 comments

I have a QR Code that I'd like to re-generate. It is decoded using standard libraries and easily read, but regenerating it seems not possible with various tools, including with segno.

The data consists of alphanumeric characters, yet is also has one non-alphanumeric character, which implies it should be a Byte, but it is version 1 and the error correction is of type M. And under these circumstances, one cannot fit the data into the QR Code.

Goofing around with http://qrlogo.kaarposoft.dk/index.html shows that while decoding, the decoders actually switch between 3 different data modes, alphanumeric, byte, numeric respectively.

It first switches to alphanumeric mode, reads 8 bytes, then switches to byte mode, reads 1 byte, and then switches to numeric mode, and reads the rest of it. This way data is easily fit into a smaller QR.

Reading the API, I've failed to find a way to switch between modes midway in the data, since I can only feed one mode and one set of data. Is it possible somehow?

heuer commented

Thanks for your msg.

It is possible but not well documented or not documented at all.

See issue #76 for details.

Thanks, I've managed to do it with the examples discussed in that issue. Closing this one to avoid confusion.
Thanks again for the help.