UTF-8 problems while reading CSV file with fgetcsv

前端 未结 6 1269
[愿得一人]
[愿得一人] 2020-12-02 22:45

I try to read a CSV and echo the content. But the content displays the characters wrong.

Mäx Müstermänn -> Mäx Müstermänn

Encoding of the CSV file is UT

6条回答
  •  心在旅途
    2020-12-02 23:11

    Now I got it working (after removing the header command). I think the problem was that the encoding of the php file was in ISO-8859-1. I set it to UTF-8 without BOM. I thought I already have done that, but perhaps I made an additional undo.

    Furthermore, I used SET NAMES 'utf8' for the database. Now it is also correct in the database.

提交回复
热议问题