Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question: automatic char at the end #75

Closed
Juliuss11 opened this issue Jun 23, 2017 · 4 comments
Closed

question: automatic char at the end #75

Juliuss11 opened this issue Jun 23, 2017 · 4 comments

Comments

@Juliuss11
Copy link

Hi all,
thank for this fantastic library, it is very simple to use.
The only problem that I found is that at the end of the string is added, by default, a /n that it is uncomfortable in some application. (you can see it for example if you try to create an empty QRcode). It is possible to remove it? Thanks you so much

@tilkinsc
Copy link

A \n is appended to what exactly? That was really unclear.

@Juliuss11
Copy link
Author

QRCodeData qrCodeData = qrGenerator.CreateQrCode(inputString, QRCodeGenerator.ECCLevel.Q);

At the end of the inputString a \n is appended. The easiest mode to see it is use an empty string.
inputString = ""
The program in this case should not be able to create a QRcode, since there is nothing to convert.

In the same way, whatever is the inputString, the last character of the QRcode is a \n

@codebude
Copy link
Owner

Are you sure, that this linebreak isn't added by your scanner app? (By the way which app/code do you use to decode the QR code?)

I generated a QR code with your code above and stepped through the source of QrCoder. I can't find any code line, where a linebreak would be added.

After that I checked the QR code with Henrik Kaare Poulsen's QR code debugger. That's the result:

left=80 right=499 top=80 bottom=499
size=420
matchVersion version=1 finder0=64 finder1=64 finder2=64
matchVersion version=1 timing0=1 timing1=1 alignment=1
matchVersion version=1 format_NW =24 0 format_NESW =24 0 format = 24 ecl = 3 mask = 0
matchVersion version=1 grades(F(V)TAF): 4444->4
findModuleSize version=1 grade=4 error_correction_level=3 mask=0
getCodewords mask=0 length=26
getCodewords = 16,0,0,236,17,236,17,236,17,236,17,236,17,30,193,101,250,78,211,164,186,198,156,226,144,6
setBlocks n_blocks_first=1 n_blocks_second=0 n_blocks=1 n_block_words_first=13 n_block_words_second=0 n_block_ec_words=13 total=26
setBlocks block 0 (26): 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
RS calculateSyndroms: No errors
correctErrors in = 16,0,0,236,17,236,17,236,17,236,17,236,17,30,193,101,250,78,211,164,186,198,156,226,144,6
correctErrors out = 16,0,0,236,17,236,17,236,17,236,17,236,17
error_grade=4
extractData bytes in (13) = 16,0,0,236,17,236,17,236,17,236,17,236,17
extractData mode = 1
extractNumeric charcount = 0
extractData mode = 0
extractData data(0) =

As you can see the payload contains 0 chars (extractNumeric charcount = 0). It says numeric char count, because QR coder chooses the mode with the highest enconding possible. Since there are no input chars the Numeric mode is valid and since it has the best compression, it was used.

Also the output (extractData data(0) =) is empty. So I think the new line is added by your code or the QR code reader you used for reading the code.

@codebude
Copy link
Owner

Hi @Juliuss11 - can you re-check this? Or can anybody else proof or disprove my comment above? Otherwise I would like to close this issue in the next couple of days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants