FIX: upload watched words should use UTF-8

This commit is contained in:
Neil Lalonde
2019-03-21 13:46:10 -04:00
parent 1f1d3909e5
commit 1812a38f0a
3 changed files with 28 additions and 1 deletions

View File

@@ -25,7 +25,7 @@ class Admin::WatchedWordsController < Admin::AdminController
Scheduler::Defer.later("Upload watched words") do
begin
File.open(file.tempfile, encoding: "ISO-8859-1").each_line do |line|
File.open(file.tempfile, encoding: "bom|utf-8").each_line do |line|
WatchedWord.create_or_update_word(word: line, action_key: action_key) unless line.empty?
end
data = { url: '/ok' }