AvroCsvBundle
AvroCsvBundle copied to clipboard
Encoding problem
Hello,
i was in front of an encoding problem,
the CSV file was in ISO so i had an error An exception has been thrown during the rendering of a template ("Warning: htmlspecialchars() [function.htmlspecialchars]
So in : Util/Reader.php Line 45
I edited the function getRow() as following :
public function getRow() {
if (($row = fgetcsv($this->handle, 1000, $this->delimiter, $this->enclosure)) !== false) {
$this->line++;
//tweak
foreach ($row as $key => $value) {
$row[$key] = json_decode(
json_encode(
iconv(
mb_detect_encoding($value, mb_detect_order(), true), 'UTF-8', $value
)
), true
);
}
//fin tweak
return $row;
} else {
return false;
}
}