Invalid utf8 Character string + LOAD INFILE+ MYSQL LOCAL DATE

Asked

Viewed 651 times

0

I am trying to import a stock file in CSV and in this files it contains several accents À Á Ú ' ñ etc in the fields Descricao , Nomefornecedor. Bank and and fields are UTF8 at connection instance as well. so when I import the file report that General error: 1300 Invalid utf8 Character string: 'CAPA PL which is PLASTIC COVER It follows the code below it is correct because I use it in another import without accentuation. I have tried with utf8mb4. Someone can help me?

 $import = "LOAD DATA LOCAL INFILE '$filename' INTO TABLE estoque_sap CHARACTER SET UTF8 FIELDS TERMINATED BY ';' IGNORE 1 LINES ( Material, Descricao, @Estoque, Deposito, TipoDeposito, Posicao, HU, Tipo, Fornecedor, NomeFornecedor, @DataEntrada, Centro) SET Estoque = REPLACE( REPLACE( @Estoque, '.' ,'' ), ',', '.' ), DataEntrada = STR_TO_DATE(@DataEntrada, '%Y-%m-%d')";  
            $stmt = $PDO->prepare($import);
            $stmt->execute(); 

1 answer

0


I’ve only managed to put CHARACTER SET Latin1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.