#991 CSV export truncated (system dependent, since 2.0) due to a bug in iconv, the workaround is to do little by little -retrofit from trunk

SVN:2.0.3[3353]
This commit is contained in:
Romain Quetiez
2014-09-25 15:07:01 +00:00
parent 5fd193885e
commit 4c735a6dff
3 changed files with 11 additions and 10 deletions

View File

@@ -180,15 +180,15 @@ try
if ($sFileName != null)
{
$oP = new CSVPage("iTop - Export");
$sCSVData = cmdbAbstractObject::GetSetAsCSV($oErrorObjectSet, array('localize_values' => true, 'fields_advanced' => $bAdvanced));
$sCharset = MetaModel::GetConfig()->Get('csv_file_default_charset');
$sCSVData = cmdbAbstractObject::GetSetAsCSV($oErrorObjectSet, array('localize_values' => true, 'fields_advanced' => $bAdvanced), $sCharset);
if ($sCharset == 'UTF-8')
{
$sOutputData = UTF8_BOM.iconv('UTF-8', 'UTF-8//IGNORE//TRANSLIT', $sCSVData);
$sOutputData = UTF8_BOM.$sCSVData;
}
else
{
$sOutputData = iconv('UTF-8', $sCharset.'//IGNORE//TRANSLIT', $sCSVData);
$sOutputData = $sCSVData;
}
if ($sFileName == '')
{