force patch messages to be considered as utf-8 (#10233)

This commit is contained in:
Frédéric Péters 2016-03-08 15:58:39 +01:00
parent c49b7aabe6
commit 4c772944d3
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ module AttachmentsControllerPatch
@diff_type = params[:type] || User.current.pref[:diff_type] || 'inline'
@diff_type = 'inline' unless %w(inline sbs).include?(@diff_type)
if (@diff.start_with?("From"))
@diff_format_patch = @diff.match(/(Subject.*)^---$/m)[0].sub(/^---$/m, '');
@diff_format_patch = @diff.match(/(Subject.*)^---$/m)[0].sub(/^---$/m, '').force_encoding('UTF-8');
else
@diff_format_patch = nil;
end