dankogai / p5-encode

Encode - character encodings (for Perl 5.8 or better)
https://metacpan.org/release/Encode
37 stars 51 forks source link

remove extra space when folding #43

Closed nvllsvm closed 9 years ago

nvllsvm commented 9 years ago

Folding in the encode function prepends an extra space to the new line. For example, the following:

use feature qw(say);
use Encode qw/encode decode/;

$string = 'I\"m Time Mime I\"m Time Mime I\"m Time Mime I\"m Time Mime I\"m Time Mime I\"m Time Mime';
$string = encode('MIME-Header', $string);

say $string;

Returns:

I\"m Time Mime I\"m Time Mime I\"m Time Mime I\"m Time Mime I\"
 m Time Mime I\"m Time Mime

When it should return:

I\"m Time Mime I\"m Time Mime I\"m Time Mime I\"m Time Mime I\"
m Time Mime I\"m Time Mime