Encoding BOM Win Mac
-------- --- ---------------------------- ------------
utf-8 -- scrambled scrambled
utf-8 BOM WORKS scrambled
utf-16 -- file not recognized file not recognized
utf-16 BOM file not recognized Chinese gibberish
utf-16LE -- file not recognized file not recognized
utf-16LE BOM characters OK, same as Win
row data all in first field
最好的编码方式是带BOM的UTF-16LE,但CSV不会识别它。字段分隔符是逗号,但分号也不影响。
是否有一种编码方式适用于这两个世界?
mb_convert_encoding($str, "UTF-16LE");
,并在这里发布结果。 - Timm