Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
ronaldxs opened this Issue · 4 comments

2 participants

ronaldxs Reini Urban
ronaldxs

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
Reini Urban rurban referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Reini Urban rurban referenced this issue from a commit
Reini Urban rurban [GH #826] fix t/library/mime_base64.t
split lines at 76 chars
eb5f55e
Reini Urban rurban referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Reini Urban rurban referenced this issue from a commit
Reini Urban rurban [GH #826] Split mime base64 lines at 76 chars
Theoretically. The tests still fails
7e68992
Reini Urban
Collaborator

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?

Reini Urban rurban was assigned
Reini Urban rurban referenced this issue from a commit
Reini Urban rurban [GH #826] Fixed wrong mime_base64.t linebreaks
Added proper \n
0cfe997
Reini Urban
Collaborator

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

ronaldxs

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.

Reini Urban
Collaborator

Merged in bf3a079

Reini Urban rurban closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.