I have an ANSI encoded CSV file and I need to change the encoding to UTF-8 when I upload the file to a server.
I'm using cakephp 2.x I need this for correct read row by row my csv file.
function import() {
if ($this->request->is('post') || $this->request->is('put')) {
$file = $this->request->data['Document']['submittedfile'];
// NOW CHANGE ENCODING - but how ?
// $this->pdfadd1->save($this->request->data);$filename = TMP . 'uploads' . DS . 'Address' . DS . $filename;
move_uploaded_file($this->data['Document']['submittedfile']['tmp_name'], TMP . 'uploads' . DS . 'Good' . DS . "towary.csv");
$messages = $this->Good->import("towary.csv");
$this->set('messages', $messages);
}