CSV file Comma Separator Value (comma separated values). Intermediate files commonly used for data conversion exist, such as exporting data from Mysql to CSV and importing CSV into SqlServer.
CSV file Comma Separator Value. Intermediate files commonly used for data conversion exist, such as exporting data from Mysql to CSV and importing CSV into SqlServer. In the Linux environment, PHP exports the table data from the MySQL database into csv according to conditions, and uses UTF-8 encoding to export the CSV file. After opening, the Chinese becomes garbled (CSV files under Windows are associated with Microsoft Excel by default), use Notepad++ or Word It opens normally, but the layout is messy. The reason is: BOM. What is BOM? Byte Order Mark. In order to recognize Unicode files, Microsoft recommends that all Unicode files should start with ZERO WIDTH NOBREAK SPACE characters. This serves as a "signature" or "byte-order mark (BOM)" to identify the encoding and byte order (big-endian or little-endian) used in the file. The specific correspondence is shown in the table below . BOMs are not used in Unix-like systems because they break existing ASCII file syntax conventions. Code: Note: When writing the csv file, ensure that the PHP source code is utf-8, has no BOM, and does not output anything. The webpage (*.html) has a BOM, and a magical blank line will appear when opened under IE6.x. This strange phenomenon does not exist in Firefox. |