So I have a CSV file that contains non UTF-8 text and I want to load data to a table n my database, for that I use:
$con->query("LOAD DATA INFILE '$csv' INTO TABLE bdi_csv FIELDS TERMINATED BY ',' LINES TERMINATED BY '\\n';");
But I get the following error:
Error: Incorrect string value: '\xF3n'
My table and database have UTF-8 charset and the CSV file is non UTF-8 (in Notepad++ shows ANSI as encoding).
EDIT: Thanks to @Fred -ii- by his comment: open the CSV file and use "convert to UTF-8" (Notepad++ Encoding)