Skip to content

Commit e03fd5a

Browse files
author
invist@thinkpwn
committed
Added encoding for bad chars
Signed-off-by: CF <cf@data-co.de>
1 parent a4fbb6b commit e03fd5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/git/diff.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def process_full_diff
130130
if @full_diff.encoding.name != "UTF-8"
131131
full_diff_utf8_encoded = @full_diff.encode("UTF-8", "binary", { :invalid => :replace, :undef => :replace })
132132
else
133-
full_diff_utf8_encoded = @full_diff
133+
full_diff_utf8_encoded = @full_diff.encode("UTF-8", "UTF-8", { :invalid => :replace, :undef => :replace }))
134134
end
135135
full_diff_utf8_encoded.split("\n").each do |line|
136136
if m = /^diff --git a\/(.*?) b\/(.*?)/.match(line)

0 commit comments

Comments
 (0)