summaryrefslogtreecommitdiff
path: root/ext/Encode/lib/Encode/MIME/Header.pm
diff options
context:
space:
mode:
Diffstat (limited to 'ext/Encode/lib/Encode/MIME/Header.pm')
-rw-r--r--ext/Encode/lib/Encode/MIME/Header.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/Encode/lib/Encode/MIME/Header.pm b/ext/Encode/lib/Encode/MIME/Header.pm
index 683348a985..09dd55e0db 100644
--- a/ext/Encode/lib/Encode/MIME/Header.pm
+++ b/ext/Encode/lib/Encode/MIME/Header.pm
@@ -1,7 +1,7 @@
package Encode::MIME::Header;
use strict;
# use warnings;
-our $VERSION = do { my @r = (q$Revision: 1.3 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 1.4 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
use Encode qw(find_encoding encode_utf8);
use MIME::Base64;
@@ -128,7 +128,9 @@ sub _encode{
my ($o, $str) = @_;
my $enc = $o->{encode};
my $llen = ($o->{bpl} - length(HEAD) - 2 - length(TAIL));
- $llen *= $enc eq 'B' ? 3/4 : 1/3;
+ # to coerce a floating-point arithmetics, the following contains
+ # .0 in numbers -- dankogai
+ $llen *= $enc eq 'B' ? 3.0/4.0 : 1.0/3.0;
my @result = ();
my $chunk = '';
while(my $chr = substr($str, 0, 1, '')){