Skip to content

Commit a68e1b6

Browse files
authored
Merge pull request #3714 from mlibrary/HELIO-4772/tmm_task_tidy_encoding_string
HELIO-4772 - align input CSV encoding and comment with reality
2 parents 587aea9 + c16fc4a commit a68e1b6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/tasks/tmm/tmm_csv_monograph_create_update.rake

+3-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ namespace :heliotrope do
3434
fail "CSV file may accidentally be a backup as '#{input_file}' contains 'bak'. Exiting." if input_file.include? 'bak'
3535

3636
puts "Parsing file: #{input_file}"
37-
# we need UTF-8 and TMM needs to export UTF-16LE for now because of this kind of thing: https://dba.stackexchange.com/a/250018
38-
# unfortunately we need to read this file into memory to force uniform line endings before parsing the CSV.
39-
# side note: although the
40-
file_content = File.read(input_file, encoding: 'bom|utf-16le')
37+
# Firebrand are finally good with UTF8. Note that it's crucial for Ruby to know there's a BOM or the first column is lost.
38+
# Unfortunately we need to read this file into memory to force uniform line endings before parsing the CSV.
39+
file_content = File.read(input_file, encoding: 'bom|utf-8')
4140
# Use `gsub!` to avoid holding more memory (I guess).
4241
file_content.gsub!(/\r\n?/, "\n")
4342

0 commit comments

Comments
 (0)