I have a model Person
when i save a new Person through the console with unicode for eg:
p = Person.new
p.name = "Hans"
p.street = "Jo\u00DFstreet"
p.save
It returns on p.street
Joßstreet
what is correct. But when i try in my seeds to build from a file:
file.txt
Hans;Jo\u00DFstreet
Jospeh;Baiuvarenstreet
and run this in my seed:
File.readlines('file.txt').each do |line|
f = line.split(';')
p = Person.new
p.name = p[0]
p.street = p[1]
p.save
end
Now when i call for eg: p = Person.last
i get p.street => "Jo\\u00DFstreet"
I dont understand why the \u00DF
gets escaped! What can i do to fix this problem? Thanks