tags:

views:

1893

answers:

3

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?

+2  A: 

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

NoWhereMan
+1  A: 

Hi Chris

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

A: 

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