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

Already on GitHub? Sign in to your account

MIME Base64 does not break up encoding lines after 76 characters as advertised and expected by MIME #826

Closed
ronaldxs opened this Issue Sep 9, 2012 · 4 comments

Comments

Projects
None yet
2 participants
Contributor

ronaldxs commented Sep 9, 2012

MIME Base64 requires encoded lines be broken after 76 characters and the library code documentation mentions the feature, but I don't see it in the actual code or the tests or the output of the example below.

Ron

.sub test :main
    load_bytecode 'MIME/Base64.pbc'

    .local pmc enc_sub
    enc_sub = get_global [ "MIME"; "Base64" ], 'encode_base64'

    .local pmc is
    is   = get_hll_global [ 'Test'; 'More' ], 'is'

    .local string result_encode
    result_encode = enc_sub( 'This line will be encoded into more than 76 characters and the encoding should be broken into multiple lines for MIME' )
    say result_encode
.end

@rurban rurban pushed a commit that referenced this issue Sep 24, 2012

Reini Urban [GH #826] fix t/library/mime_base64.t
split lines at 76 chars
eb5f55e

@rurban rurban pushed a commit that referenced this issue Sep 24, 2012

Reini Urban [GH #826] Split mime base64 lines at 76 chars
Theoretically. The tests still fails
7e68992
Member

rurban commented Sep 24, 2012

I'm pretty sure I fixed the problem with commit 7e68992
But it guess the test eats the \n and needs to be fixed also.

Can you please try?

@ghost ghost assigned rurban Sep 24, 2012

@rurban rurban pushed a commit that referenced this issue Sep 24, 2012

Reini Urban [GH #826] Fixed wrong mime_base64.t linebreaks
Added proper \n
0cfe997
Member

rurban commented Sep 24, 2012

branch rurban/mime-base64-linesplit-gh826 is ready to be merged

Contributor

ronaldxs commented Sep 24, 2012

I downloaded the branch and tested mime_base64.t, AFAICT everything looks fine. Please be aware, before you put too much more effort in the current mime/base64 implentation, that I am working on an NCI version using the source for the base64 utility that is part of gnu coreutils . An earlier 'C' implementation by the author of the coreutils code is referenced in one of the base64 RFCs, so the code there can be expected to adhere to standards well. I hope to have a working NCI module on github sometime next week.

Member

rurban commented Sep 25, 2012

Merged in bf3a079

@rurban rurban closed this Sep 25, 2012

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