diff --git a/app/helpers/file_helper.rb b/app/helpers/file_helper.rb index 362d9597c..3772291ff 100644 --- a/app/helpers/file_helper.rb +++ b/app/helpers/file_helper.rb @@ -547,40 +547,43 @@ def move_compressed_task_to_new(task) task.extract_file_from_done student_work_dir(:new), '*', ->(_task, to_path, name) { "#{to_path}#{name}" } end - REPLACEMENTS_SED_COMMAND = [ - ['[\\]u0000','␀'], - ['[\\]u0001','␁'], - ['[\\]u0002','␂'], - ['[\\]u0003','␃'], - ['[\\]u0004','␄'], - ['[\\]u0005','␅'], - ['[\\]u0006','␆'], - ['[\\]u0007','␇'], - ['[\\]u0008','␈'], - ['[\\]u0009','␉'], - ['[\\]u000A','␊'], - ['[\\]u000B','␋'], - ['[\\]u000C','␌'], - ['[\\]u000D','␍'], - ['[\\]u000E','␎'], - ['[\\]u000F','␏'], - ['[\\]u0010','␐'], - ['[\\]u0011','␑'], - ['[\\]u0012','␒'], - ['[\\]u0013','␓'], - ['[\\]u0014','␔'], - ['[\\]u0015','␕'], - ['[\\]u0016','␖'], - ['[\\]u0017','␗'], - ['[\\]u0018','␘'], - ['[\\]u0019','␙'], - ['[\\]u001A','␚'], - ['[\\]u001B','␛'], - ['[\\]u001C','␜'], - ['[\\]u001D','␝'], - ['[\\]u001E','␞'], - ['[\\]u001F','␟'] - ].map { |r| "s/#{r[0]}/#{r[1]}/gI" }.join('; ').freeze + REPLACEMENTS_PERL_COMMAND = [ + ['[\\\\]u0000','[NUL]'], + ['[\\\\]u0001','[SOH]'], + ['[\\\\]u0002','[STX]'], + ['[\\\\]u0003','[ETX]'], + ['[\\\\]u0004','[EOT]'], + ['[\\\\]u0005','[ENQ]'], + ['[\\\\]u0006','[ACK]'], + ['[\\\\]u0007','[BEL]'], + ['[\\\\]u0008','[BS]'], + ['(?