File tree 1 file changed +2
-8
lines changed
1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ fn decode(input: &mut Reader, ignore_garbage: bool) {
142
142
fn encode ( input : & mut Reader , line_wrap : uint ) {
143
143
let b64_conf = base64:: Config {
144
144
char_set : base64:: Standard ,
145
+ newline : base64:: Newline :: LF ,
145
146
pad : true ,
146
147
line_length : match line_wrap {
147
148
0 => None ,
@@ -154,14 +155,7 @@ fn encode(input: &mut Reader, line_wrap: uint) {
154
155
} ;
155
156
let encoded = to_encode. as_slice ( ) . to_base64 ( b64_conf) ;
156
157
157
- // To my knowledge, RFC 3548 does not specify which line endings to use. It
158
- // seems that rust's base64 algorithm uses CRLF as prescribed by RFC 2045.
159
- // However, since GNU base64 outputs only LF (presumably because that is
160
- // the standard UNIX line ending), we strip CRs from the output to maintain
161
- // compatibility.
162
- let output = encoded. replace ( "\r " , "" ) ;
163
-
164
- println ( output. as_slice ( ) ) ;
158
+ println ( encoded. as_slice ( ) ) ;
165
159
}
166
160
167
161
fn help ( progname : & str , usage : & str ) {
You can’t perform that action at this time.
0 commit comments