Word Document.SaveAs ignores encoding, when calling through OLE, from Ruby or VBS
问题 I have a script, VBS or Ruby, that saves a Word document as 'Filtered HTML', but the encoding parameter is ignored. The HTML file is always encoded in Windows-1252. I'm using Word 2007 SP3 on Windows 7 SP1. Ruby Example: require 'win32ole' word = WIN32OLE.new('Word.Application') word.visible = false word_document = word.documents.open('C:\whatever.doc') word_document.saveas({'FileName' => 'C:\whatever.html', 'FileFormat' => 10, 'Encoding' => 65001}) word_document.close() word.quit VBS Example