in this Grails application, I'm exporting database registers to a csv file using the code:
response.setHeader "Content-disposition", "attachment; filename=creds.csv"
response.contentType = 'text/csv; charset=UTF-8'
response.setCharacterEncoding("UTF-8")
response.outputStream << respstr
response.outputStream.flush()
and the file downloaded by the browser has accents issues.
I can tell the data in the db is ok because I also implemented the generation of xls files using apache.poi.* and the accents are displayed just fine.
psql -l returns:
Name | Owner | Encoding | Collation | Ctype |
mydb | postgres | SQL_ASCII | C | C |
What should I change to make it work ? Thanks