From 033e7071d3aa10c39e4d410fc4cd5c9d277c65c6 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 9 Dec 2016 19:54:36 +0800 Subject: [PATCH] small fix for utf encoding --- app/views/admin/surveys/export.xlsx.axlsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/admin/surveys/export.xlsx.axlsx b/app/views/admin/surveys/export.xlsx.axlsx index 4ba168a..f557e67 100644 --- a/app/views/admin/surveys/export.xlsx.axlsx +++ b/app/views/admin/surveys/export.xlsx.axlsx @@ -68,7 +68,7 @@ wb.add_worksheet(name: remove_illegal_utf8(@survey.title[0..15])) do |sheet| else if answer[question.id.to_s] - answer_row << answer[question.id.to_s] + answer_row << remove_illegal_utf8(answer[question.id.to_s]) else answer_row << '' end @@ -77,9 +77,9 @@ wb.add_worksheet(name: remove_illegal_utf8(@survey.title[0..15])) do |sheet| if question.custom_option if !answer[question.id.to_s].blank? if answer[question.id.to_s].class == Array - answer_row << (answer[question.id.to_s] - options).join + answer_row << remove_illegal_utf8((answer[question.id.to_s] - options).join) elsif answer[question.id.to_s].class == String - answer_row << ([answer[question.id.to_s]] - options).join + answer_row << remove_illegal_utf8(([answer[question.id.to_s]] - options).join) end else answer_row << ''