Skip to content

Commit 60ce0ca

Browse files
committed
REW-2045 - return str and not nil if string is UTF8 already ( was causing spec failures)
1 parent b411e87 commit 60ce0ca

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/models/concerns/csv2db/import.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ def set_default_values
194194
end
195195

196196
def str_to_utf8(str)
197-
return if str_encoding(str) == 'UTF-8'
197+
return str if str_encoding(str) == 'UTF-8'
198198

199-
CharlockHolmes::Converter.convert(str, str.detect_encoding[:encoding], 'UTF-8')
199+
CharlockHolmes::Converter.convert(str, str_encoding(str), 'UTF-8')
200200
end
201201

202202
def str_encoding(str)

0 commit comments

Comments
 (0)