fixes #6334 Encoding not correct when importing data