diff --git a/app/models/submission.rb b/app/models/submission.rb index 6e306035a..95f2e5757 100755 --- a/app/models/submission.rb +++ b/app/models/submission.rb @@ -137,7 +137,7 @@ def annotated_file(file, filename, position) conditions[:position] = position if position annotations = self.annotations.where(conditions) - result = file.lines.map { |line| [line, nil] } + result = file.lines.map { |line| [line.force_encoding("UTF-8"), nil] } # annotation lines are one-indexed, so adjust for the zero-indexed array annotations.each { |a| result[a.line-1][1] = a}