note 110010 modified in function.mb-convert-encoding by danbrown
| From: | danbrown@php.net | Date: | Wed, 12 Sep 2012 17:28:27 +0000 |
| Subject: | note 110010 modified in function.mb-convert-encoding by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190662@lists.php.net to get a copy of this message | ||
If you are trying to generate a CSV (with extended chars) to be opened at Exel for Mac, the only
that worked for me was: <?php mb_convert_encoding( $CSV,
'Windows-1252', 'UTF-8');
?> I also tried
this: <?php //Separado OK, chars
MAL iconv('MACINTOSH', 'UTF8',
$CSV); //Separado MAL, chars
OK chr(255).chr(254).mb_convert_encoding( $CSV, 'UCS-2LE',
'UTF-8'); ?> But the
first one didn't show extended chars correctly, and the second one, did't separe
fields correctly
--was--
If you are trying to generate a CSV (with extended chars) to be opened at Exel for Mac, the only
that worked for me was:
mb_convert_encoding( $CSV, 'Windows-1252', 'UTF-8');
I also tried this:
//Separado OK, chars MAL
iconv('MACINTOSH', 'UTF8', $CSV);
//Separado MAL, chars OK
chr(255).chr(254).mb_convert_encoding( $CSV, 'UCS-2LE', 'UTF-8');
But the first one didn't show extended chars correctly, and the second one, did't separe
fields correctly
http://php.net/manual/en/function.mb-convert-encoding.php