ricmoo / QRCode

QR code generation library in C, optimized for low-power devices, such as Arduino.
Other
638 stars 202 forks source link

Is it possible to add "carriage return" to Numeric mode? #39

Open electrosaeed opened 4 months ago

electrosaeed commented 4 months ago

Hi, Is it possible to add "carriage return" to Numeric mode? It seems it is not exist in ALPHANUMERIC too. So we should use Byte mode to have \r char.

ricmoo commented 4 months ago

That's correct. The Numeric and Alphanumeric modes are (intentionally) highly constrained.

Sorry. :s

electrosaeed commented 4 months ago

Thanks, but is it possible for me to add them (\r\n) to one of the Numeric or Alphanumeric?

ricmoo commented 4 months ago

No, it's a widely adopted standard. :)

If you add them, your QR code will be read incorrectly when scanned by any other QR scanning software...

electrosaeed commented 4 months ago

I believe your answer is correct, but because it is important for me I asked the chatGPT this question. this is the answer:

"In modes 1 (Numeric) and 2 (Alphanumeric) in QR code, you cannot directly insert a new line character. However, you can use ASCII code for the newline character, which is equivalent to 10, and include it as text in your input. For example, if you want to insert a new line after the number 100 in mode 1 (Numeric), you can use the ASCII code for the newline character, which is equivalent to 10, and include it as text in your input."

Do you think it is possible?

ricmoo commented 4 months ago

I don't, but you can try. :)

Here is some info I found useful when implementing it: