Skip to content

Commit f1b113f

Browse files
committed
Merge pull request #46 from workgena/master
universal_newline - Replaces \rn and \r with \n
2 parents 8d78ff9 + 9dea68a commit f1b113f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/active_admin_import/model.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,10 @@ def define_methods_for(attr_name)
138138

139139
def encode(data)
140140
data = content_encode(data) if force_encoding?
141-
data = data.encode('UTF-8',
142-
invalid: :replace, undef: :replace)
141+
data = data.encode(
142+
'UTF-8',
143+
invalid: :replace, undef: :replace, universal_newline: true
144+
)
143145
begin
144146
data.sub("\xEF\xBB\xBF", '') # bom
145147
rescue StandardError => _

0 commit comments

Comments
 (0)