lib/mercurial-ruby/diff.rb in mercurial-ruby-0.7.8 vs lib/mercurial-ruby/diff.rb in mercurial-ruby-0.7.9
- old
+ new
@@ -29,10 +29,15 @@
@hash_b = opts[:hash_b]
@file_a = opts[:file_a]
@file_b = opts[:file_b]
@body = opts[:body]
@binary = opts[:binary]
+
+ if RUBY_VERSION >= '1.9.1'
+ @file_a.force_encoding('utf-8') if @file_a
+ @file_b.force_encoding('utf-8') if @file_b
+ end
end
def file_name
file_b || file_a
end
@@ -41,6 +46,6 @@
!! @binary
end
end
-end
\ No newline at end of file
+end