Hacker News new | past | comments | ask | show | jobs | submit login

> Byte mode uses (you guessed it!) 8 bits per single character.

8 bits is enough to represent the entire ascii char table, there must be some other limitation going on. QR code control chars maybe?

The linked "byte mode" table only has 45 individual chars. This could be represented with 6 bits with room to spare..




> 8 bits is enough to represent the entire ascii char table, there must be some other limitation going on. QR code control chars maybe?

The specified capacity of "25 characters" for QR code size is 25 characters in alphanumeric mode, not in byte mode.

> The linked "byte mode" table only has 45 individual chars. This could be represented with 6 bits with room to spare..

Even better than that - it's 5.5 bits per character! Each pair of characters is represented as a single 11-bit code unit. (This works because 45 x 45 = 2025, which is just barely under 2^11 = 2048.)

There's apparently some support in the QR standard for mixed-encoding codes, but few encoders seem to use that.


Apparently you can specify the text encoding in a thing called “ECI”, but support varies and most readers just guess the encoding by the bytes. I imagine these days most are UTF8 https://stackoverflow.com/questions/9699657/is-utf-8-the-enc...


> The linked "byte mode" table only has 45 individual chars.

No, that link is for alphanumeric mode, which uses 5.5 bits per character (45 * 45 = 2025 <= 2048, so it fits in 11 bits).




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: