small fix for utf encoding

This commit is contained in:
Harry Bomrah 2016-12-09 19:54:36 +08:00
parent bfd2b8abeb
commit 033e7071d3
1 changed files with 3 additions and 3 deletions

View File

@ -68,7 +68,7 @@ wb.add_worksheet(name: remove_illegal_utf8(@survey.title[0..15])) do |sheet|
else else
if answer[question.id.to_s] if answer[question.id.to_s]
answer_row << answer[question.id.to_s] answer_row << remove_illegal_utf8(answer[question.id.to_s])
else else
answer_row << '' answer_row << ''
end end
@ -77,9 +77,9 @@ wb.add_worksheet(name: remove_illegal_utf8(@survey.title[0..15])) do |sheet|
if question.custom_option if question.custom_option
if !answer[question.id.to_s].blank? if !answer[question.id.to_s].blank?
if answer[question.id.to_s].class == Array 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 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 end
else else
answer_row << '' answer_row << ''