csv problem encoding utf-8

csv problem encoding utf-8

Monday 24 January 2011 1:44:18 am - 4 replies

Author Message

Frédéric RINALDI

Monday 24 January 2011 2:12:52 am

Dear Amine,

I suppose you use header functions to export to CSV?

header("Content-Disposition: attachment; filename='yourCsvFile.csv" ) ;
header("Cache-Control: cache, must-revalidate" ) ;
header("Pragma: public" ) ;

Do you use a encoding feature?
header('Content-Type: text/xml, charset=UTF-8; encoding=UTF-8');

Yours,

Amine BETARI

Monday 24 January 2011 4:05:22 am

I use:
header('Content-Type: application/csv; utf-8');
header("Content-Type: application/force-download");
header('Content-Disposition: attachment; filename="'.$fileName.'.csv"');
but I tried to use what you offered me but I had the same problem
Thank you very much

Frédéric RINALDI

Monday 24 January 2011 8:05:25 am

Do you try utf8_encode function? and maybe mb_detect_encoding to get the wrong encoding of your content.

Amine BETARI

Monday 24 January 2011 9:08:53 am

which is weird, I used the function utf_decode () for words containing accents and it works well
!!!!!!!!!!!!!!!!!

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.