问题
My code works, but instead of Russian characters incomprehensible characters are displayed. My code:
local fileName = "myfile3.doc"
local FileWrite
FileWrite = io.open(fileName, "w")
FileWrite:write("фывф", '\n')
FileWrite:close()
or
require('luacom')
excel = luacom.CreateObject("Excel.Application")
excel.Visible = true
wb = excel.Workbooks:Add()
ws = wb.Worksheets(1)
for i=1, 10 do
ws.Cells(i,1).Value2 = "фывф"
end
回答1:
It works for me exactly as written. I used UTF-8 encoding for the file (CP65001 on Win8). Here is the snapshot of the result:
来源:https://stackoverflow.com/questions/58013508/when-creating-a-doc-or-excel-file-using-the-lua-language-russian-characters-are