6

I have a system that exports a .csv file and some of the rows contain special box characters such that the data looks like this:

Please specify the primary type of opportunity which you’re proposing:
└─ Please specify what type of sport:
└─ What is this person’s vocation?
└── How long have they been in the industry?

However, when I open the file in excel, Excel warps the box characters so that it ends up looking like this:

Please specify the primary type of opportunity which you’re proposing:    
└─ Please specify what type of sport:   
└─ What is this person’s vocation?    
└── How long have they been in the industry?  

The file is being saved as plain-text to the user's hard drive, and I can open it in a text editor and see the characters fine, so I know it's something happening when Excel reads in the data.

Any thoughts? How can I prevent this?

Chris
  • 27,596
  • 25
  • 124
  • 225

3 Answers3

5

In a PHP generated CSV I solved it with utf8_decode() for the concerning columns.

ownking
  • 1,956
  • 1
  • 24
  • 34
3

Import your csv file as shown in the link below in Excel 2007. Select appropriate Encoding as a result will show expected Data including Special characters. http://www.howtogeek.com/howto/microsoft-office/import-text-into-excel-2007/

Regards, Kuldeep Rathod

2

excel is probably trying to open the file using the wrong encoding; try opening the file from within Excel, and choose a different file encoding; those are probably Unicode characters, and Excel is probably using iso-8859-15 to import.

Choose UTF if possible

HTH

Edoardo Vacchi
  • 1,284
  • 10
  • 18