Can I export excel data with UTF-8 without BOM?

后端 未结 6 1358
慢半拍i
慢半拍i 2020-12-01 04:00

I export Microsoft Excel data by Excel Macro(VBScript). Because file is lua script, I export it as UTF-8. The only way I can make UTF-8 in Excel is using adodb.stream like t

6条回答
  •  一个人的身影
    2020-12-01 04:24

    A few possibilities:

    1. Put the text into the buffer as UTF-8, Type=2, but then set Type=1 (as binary) and write that out. That might convince ADODB.Stream to skip adding the BOM.

    2. Create another buffer, as type binary, and use the CopyTo to copy the data to that buffer from a point after the BOM.

    3. Read the file in again using Scripting.FileSystemObject, trim off the BOM, write out again

提交回复
热议问题