PHP Unicode

fgetcsv

The fgetcsv function in PHP will truncate data if it has one-byte characters. A fix:

while ($data = fgetcsv($handle, $line_max, ',')) {
     $data = array_map(utf8_encode, $data);
}