Commit a1638748 authored by Shinya Maeda's avatar Shinya Maeda

put force_encoding in def reverse_line

parent 22f1d2a1
...@@ -74,7 +74,7 @@ module Gitlab ...@@ -74,7 +74,7 @@ module Gitlab
match = "" match = ""
reverse_line do |line| reverse_line do |line|
matches = line.force_encoding(regex.encoding).scan(regex) matches = line.scan(regex)
next unless matches.is_a?(Array) next unless matches.is_a?(Array)
next if matches.empty? next if matches.empty?
...@@ -108,11 +108,11 @@ module Gitlab ...@@ -108,11 +108,11 @@ module Gitlab
buf = stream.read(read_size) + debris buf = stream.read(read_size) + debris
debris, *lines = buf.each_line.to_a debris, *lines = buf.each_line.to_a
lines.reverse_each do |line| lines.reverse_each do |line|
yield(line) yield(line.force_encoding('UTF-8'))
end end
end end
yield(debris) yield(debris.force_encoding('UTF-8'))
end end
def calc_read_size(pos, max) def calc_read_size(pos, max)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment