Skip to content

Limitations on the maximum number of characters that can be entered #115

@rabbittyu

Description

@rabbittyu

@heuer

What is the maximum number of characters that can be added using segno's Structured Append?

I am facing the phenomenon that QR codes can be output but cannot be read.

The source code and the string I put in is shown below.

read correctly

import segno

qr_txt='1l2l3l4l5l6l7l8l9l10l11l12l13l14l15l16l17l18l19l20l21l22l23l24l25l26l27l28l29l30l31l32l33l34l35l36l37l38l39l40l41l42l43l44l45l46l47l48l49l50l51l52l53l54l55l56l57l58l59l60l61l62l63l64l65l66l67l68l69l70l71l72l73l74l75l76l77l78l79l80l81l82l83l84l85l86l87l88l89l90l91l92l93l94l95l96l97l98l99l100l101l102l103l104l105l106l107l108l109l110l111l112l113l114l115l116l117l118l119l120l121l122l123l124l125l126l127l128l129l130l131l132l133l134l135l136l137l138l139l140l141l142l143l144l145l146l147l148l149l150l151l152l153l154l155l156l157l158lf'
qr_txt = qr_txt.encode('utf-8')

qrcode_seq = segno.make_sequence(qr_txt, version=5, mode='byte', boost_error=False, error='L') 

(Character before decoding)
b'1l2l3l4l5l6l7l8l9l10l11l12l13l14l15l16l17l18l19l20l21l22l23l24l25l26l27l28l29l30l31l32l33l34l35l36l37l38\x0039l40l41l42l43l44l45l46l47l48l49l50l51l52l53l54l55l56l57l58l59l60l61l62l63l64l65l66l67l68l69l70l71l72l73\x0074l75l76l77l78l79l80l81l82l83l84l85l86l87l88l89l90l91l92l93l94l95l96l97l98l99l100l101l102l103l104l105l10\x00l107l108l109l110l111l112l113l114l115l116l117l118l119l120l121l122l123l124l125l126l127l128l129l130l131l132\x00133l134l135l136l137l138l139l140l141l142l143l144l145l146l147l148l149l150l151l152l153l154l155l156l157l158l\x00\r'

The last character disappeared

import segno

qr_txt='1l2l3l4l5l6l7l8l9l10l11l12l13l14l15l16l17l18l19l20l21l22l23l24l25l26l27l28l29l30l31l32l33l34l35l36l37l38l39l40l41l42l43l44l45l46l47l48l49l50l51l52l53l54l55l56l57l58l59l60l61l62l63l64l65l66l67l68l69l70l71l72l73l74l75l76l77l78l79l80l81l82l83l84l85l86l87l88l89l90l91l92l93l94l95l96l97l98l99l100l101l102l103l104l105l106l107l108l109l110l111l112l113l114l115l116l117l118l119l120l121l122l123l124l125l126l127l128l129l130l131l132l133l134l135l136l137l138l139l140l141l142l143l144l145l146l147l148l149l150l151l152l153l154l155l156l157l158l'
qr_txt = qr_txt.encode('utf-8')

qrcode_seq = segno.make_sequence(qr_txt, version=5, mode='byte', boost_error=False, error='L') 

(Character before decoding)
b'1l2l3l4l5l6l7l8l9l10l11l12l13l14l15l16l17l18l19l20l21l22l23l24l25l26l27l28l29l30l31l32l33l34l35l36l37l38\x0039l40l41l42l43l44l45l46l47l48l49l50l51l52l53l54l55l56l57l58l59l60l61l62l63l64l65l66l67l68l69l70l71l72l73\x0074l75l76l77l78l79l80l81l82l83l84l85l86l87l88l89l90l91l92l93l94l95l96l97l98l99l100l101l102l103l104l105l10\x00l107l108l109l110l111l112l113l114l115l116l117l118l119l120l121l122l123l124l125l126l127l128l129l130l131l132\x00133l134l135l136l137l138l139l140l141l142l143l144l145l146l147l148l149l150l151l152l153l154l155l156l157l158l\r'

I have tried other versions and the relationship seems to be as follows.
The number of characters that can be stored in the QR Code × Number of Structured Append - (Number of Structured Append + 1)

version=5, (max=106)
106*5-5-1=524

★The number of characters that can be stored in the QR Code => https://www.qrcode.com/en/about/version.html

It may be the specification of my QR code reader, but it seems that if the above number is exceeded, the last character is replaced by .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions