I am using package "github.com/jeffyi/sqltocsv" to export MSSql rows to CSV files.
My problem is that special characters end up wrong way:
ü as ü ä as Ƥ etc..
I have read the sqltocsv package multiple times and I just don't get that when and where is it going wrong.
i have logged output to console, before exporting data comes out from DB as UTF-8 but on adding to CSV it gets messed up.
I have tryed to use package "encoding/csv" to convert my data to csv file. (without any success)
Here's how I use sqlToCsv package:
rows, _ := db.Query(sqlQuery)
csvConverter := sqltocsv.New(rows)
csvConverter.Delimiter = ';'
csvConverter.TimeFormat = time.RFC822
csvConverter.WriteFile(directory + "/" + fileName)
so in the end result should all characters be as they are:
ü as ü (not ü ) ä as ä (not Ƥ )