How can I output a UTF-8 CSV in PHP that Excel will read properly?

后端 未结 30 2520
半阙折子戏
半阙折子戏 2020-11-22 06:08

I\'ve got this very simple thing that just outputs some stuff in CSV format, but it\'s got to be UTF-8. I open this file in TextEdit or TextMate or Dreamweaver and it displa

30条回答
  •  难免孤独
    2020-11-22 06:27

    To follow up on this:

    It appears that the problem is simply with Excel on the Mac. It's not how I'm generating the files, because even generating CSVs from Excel is breaking them. I save as CSV, and reimport, and all the characters are messed up.

    So … there doesn't appear to be a correct answer to this. Thanks for all the suggestions.

    I would say that from all I've read, @Daniel Magliola's suggestion about the BOM would probably be the best answer for some other computer. But it still doesn't solve my problem.

提交回复
热议问题