I want to convert ANSI encoding to UTF8 encoding to realize code. most of the systems I developed using php run in unix, and all the codes are utf8 (databases and webpages ), however, garbled characters often occur when reading files uploaded by windows, because the file encoding in windows is ansi. This requires conversion. First, I cannot ask the user to switch. Second, many php systems on unix do not support the mbstring module. In addition, some virtual spaces require ANSI encoding to UTF8 encoding implementation code.
Most of the systems I developed using php run in unix environments, and all the codes are utf8 (databases and webpages). However, I often read files uploaded by windows operating systems with garbled characters, the reason is that the file encoding in windows is ansi. This requires conversion.
First, I cannot ask the user to switch.
Second, many php systems on unix do not support the mbstring module. In addition, some virtual spaces do not allow any settings, not to mention adding components. So I need to manually write a conversion function to read the ansi file correctly.
Please code. thank you.
------ Solution --------------------
Iconv () does not work?
------ Solution --------------------
Provides an upload page to convert iconv from GBK to utf8.
The existing data in the database seems to have to be exported for encoding, and then iconv. then, import the data back and perform manual operations.