diff --git a/Rakefile b/Rakefile index f16f94b..0eed3cb 100644 --- a/Rakefile +++ b/Rakefile @@ -16,7 +16,7 @@ def pad(array) array.each do |row| i = 0 row.each do |col| - max[i] = [max[i] || 0, col.length].max + max[i] = [max[i] || 0, col.bytesize].max i += 1 end end @@ -24,7 +24,7 @@ def pad(array) array.each do |row| i = 0 row.each do |col| - col << " " * (max[i] - col.length) + col << " " * (max[i] - col.bytesize) i += 1 end end diff --git a/lib/mini_mime.rb b/lib/mini_mime.rb index 8055fdb..ffec0f3 100644 --- a/lib/mini_mime.rb +++ b/lib/mini_mime.rb @@ -124,7 +124,7 @@ def initialize(path, sort_order) @path = path @file = PReadFile.new(@path) - @row_length = @file.readline("\n").length + @row_length = @file.readline("\n").bytesize @file_length = File.size(@path) @rows = @file_length / @row_length