summaryrefslogtreecommitdiffstats
path: root/lib/redmine/unified_diff.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2013-03-07 10:36:06 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2013-03-07 10:36:06 +0000
commitd3de07a17c1d0066ecdee2cffac068cf79ee0fe6 (patch)
tree3a91ddc1fcb31f9e1a5b9b8234b52fcd928bea9d /lib/redmine/unified_diff.rb
parent72539451aab45ee2692376bf087d06396b4956ca (diff)
downloadredmine-d3de07a17c1d0066ecdee2cffac068cf79ee0fe6.tar.gz
redmine-d3de07a17c1d0066ecdee2cffac068cf79ee0fe6.zip
fix that diff outputs become ??? in some non ASCII words (#12641)
Contributed by Filou Centrinov. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11549 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/unified_diff.rb')
-rw-r--r--lib/redmine/unified_diff.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/redmine/unified_diff.rb b/lib/redmine/unified_diff.rb
index 2e15188fa..6fbfb80fe 100644
--- a/lib/redmine/unified_diff.rb
+++ b/lib/redmine/unified_diff.rb
@@ -199,10 +199,16 @@ module Redmine
while starting < max && line_left[starting] == line_right[starting]
starting += 1
end
+ while line_left[starting].ord.between?(128, 191) && starting > 0
+ starting -= 1
+ end
ending = -1
while ending >= -(max - starting) && line_left[ending] == line_right[ending]
ending -= 1
end
+ while line_left[ending].ord.between?(128, 191) && ending > -1
+ ending -= 1
+ end
unless starting == 0 && ending == -1
[starting, ending]
end