php 輸出excel 可讀 utf8 中文

php 輸出可讀 utf8 編碼的 excel

一開始在輸出文件前方加上BOM 告訴 excel 顯示內容的編碼 查詢 utf-16LE + BOM 可以正確顯示於 windows 及 osx 而分隔的方式是使用 \t 進行分隔,稱為 tsv (Tab-Seperated Values)

* Charset UTF-16LE (simply UTF-16 was not enough)
* BOM "\xFF\xFE"
* \t (tab) as separator
* Don't forget to encode also separator and CRLFs :-)

ref: