diff --git a/lib/attachments_controller_patch.rb b/lib/attachments_controller_patch.rb index 38ef80f..f5240be 100644 --- a/lib/attachments_controller_patch.rb +++ b/lib/attachments_controller_patch.rb @@ -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