diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index d47ce609c..794ccb228 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -208,9 +208,11 @@ class HomeworkCommonsController < ApplicationController student_work_to_xlsx(@work_excel,@homework) exercise_export_name = current_user.real_name + "_" + @course.name + "_" + @homework.name + "_" + Time.now.strftime('%Y%m%d_%H%M%S') - render xlsx: "#{exercise_export_name.encode("GBK", :invalid => :replace, :undef => :replace, :replace => " ").strip.first(30)}",template: "homework_commons/works_list.xlsx.axlsx",locals: + render xlsx: "#{exercise_export_name.encode(Encoding.default_external,"UTF-8", :invalid => :replace, :undef => :replace, :replace => " ").strip.first(30)}",template: "homework_commons/works_list.xlsx.axlsx",locals: {table_columns: @work_head_cells,task_users: @work_cells_column} } + + # .encode(Encoding.default_external, 'gb2312') end end elsif params[:format] == "zip"