I'm using PHP and MySQL LOAD DATA LOCAL INFILE
to import about 200,000 lines of data from an external file. However, I get a character issue somewhere with the text KOA
.
On Windows server, I got KO
when reading this field from database:
On Linux server, I got some unreadable code:
Therefore, I tried to encode the character O
in KOA
and found it be \x4F\xC2\x9D
instead of \x4F
...
I'm wondering if there is anyway to parse the whole file and output the correct characters without manually change the content in the file?
Possibly some functions in PHP or using NPM?
First open data file in notepad++ then click on Encoding > convert to UTF-8 and save it.
Now upload data on mysql database server.