You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing an UTF8 csv and then opening with Excel, it needs to be UTF8 with BOM, otherwise the UTF-8 characters will be messed up.
I've tried methods like,
privatestaticreadonlyEncoding_utf8WithBom=newUTF8Encoding(true);// note the `true` hereprivatestaticreadonlyCsvConfiguration_csvConfiguration=new(){StreamWriterFunc= stream =>new(stream,_utf8WithBom);};
doesn't work. Or,
stream.WriteByte(0xEF);stream.WriteByte(0xBB);stream.WriteByte(0xBF);// ... proceeds to SaveAs()
Excel Type
Upload Excel File
example).csv
MiniExcel Version
1.34.2
Description
When writing an UTF8 csv and then opening with Excel, it needs to be UTF8 with BOM, otherwise the UTF-8 characters will be messed up.
I've tried methods like,
doesn't work. Or,
doesn't work.
Solution
Since
new UTF8Encoding(true)
seems the official way in .NET of saying this encoding should come with BOM, would it be supported in the future?The text was updated successfully, but these errors were encountered: