After looking around at base64 encoders, I went back to the rfc and after a bit of rethinking, I don't think the base64 encoder needs to fold lines.
When it talks about base64 encoding of data it mentions folding:
2.4.1 BINARY
[...]Long lines of encoded binary data SHOULD BE folded to 75 characters
using the folding method defined in [MIME-DIR]
Then in 2.6 it mentions folding again
2.6 Line Delimiting and Folding
[...] After generating a content line,
lines longer than 75 characters SHOULD be folded according to the
folding procedure described in [MIME DIR].
A content line is defined as
contentline = [group "."] name *(";" param ) ":" value CRLF
(The importance being that it is the 'full line' not just the value that is folded)
When looking at 2.4.1 it implies the binary encoding should fold lines, however that seems to compete with the content line folding itself (2.6).
If binary data folding and line folding were both applied then 'double folding' would occur which I don't believe is intended. (since I know some heckler will mention the examples are not 75 characters long.. just pretend they are .. thanks) i.e.
PHOTO;ENCODING=b;TYPE=JPEG:MIICajCCAdOgAwIBAgICBEUwDQY <= line folded
MIICajCCAdOgAwI <=folded at 75 binary chars as per binary folding
kU6NuaJR+E9lJd8ux9JpuV8QS+w3wNThZJ9Tb2HNBr1B+GNO9fi75e <= line folded
[...]
A more reasonable interpretation is that the intended output is:
PHOTO;ENCODING=b;TYPE=JPEG:MIICajCCAdOgAwIBAgICBEUwDQY <=folded as per line folding
MIICajCCAdOgAwIkU6NuaJR+E9lJd8ux9JpuV8QS+w3wNThZJ9Tb2H <=folded as per line folding
NBr1B+GNO9fi75e[...]
I believe 2.4.1 is basically just reiterating the folder requirement of 2.6, which if correct implies that no base64 encoder of 75 lines is required because basic line folding of the vcard itself will achieve the desired result.
So unless proven wrong, I will go with this interpretation for now.