Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Exporting a csv file containing Portuguese characters gets mangled when opened in excel

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Our application allows the user to export some data with to a csv file. I am writing to a string bullder and using .toString.getBytes("UTF-8") and sending those bytes to the response's output stream. If the user imports it into Excel, characters with tildes, cedillas, etc. show up fine, but if the user double-clicks the file, those characters are replaced with other characters. Is there any way to make this work for both Mac and Windows or at least Windows?

Thanks,
Rob
 
Rob Dennett
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By changing the encoding to ISO-8859-1, I made it work.

Thanks,
Rob
 
Sheriff
Posts: 24654
58
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the update, Rob. I suspect this is a question which other people may have in the future.
 
No. No. No. No. Changed my mind. Wanna come down. To see this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!