diff --git a/funcext/TSOffice/TOfficeObj.tsf b/funcext/TSOffice/TOfficeObj.tsf index 63935ab..eee6167 100644 --- a/funcext/TSOffice/TOfficeObj.tsf +++ b/funcext/TSOffice/TOfficeObj.tsf @@ -1,4 +1,4 @@ -// Version 1.5.8 +// Version 1.5.9 Function TOfficeObj(n); Begin case lowercase(n) of diff --git a/funcext/TSOffice/TSDocxFile.tsf b/funcext/TSOffice/TSDocxFile.tsf index 7779f62..dbe1134 100644 --- a/funcext/TSOffice/TSDocxFile.tsf +++ b/funcext/TSOffice/TSDocxFile.tsf @@ -1,4 +1,4 @@ -// Version 1.5.8 +// Version 1.5.9 Type TSDocxFile = Class ///Version: V1.0 2022-09-20 ///适用于 Microsoft Word docx格式文件 @@ -49,7 +49,7 @@ Type TSDocxFile = Class Begin if not ifObj(zipfile_) then return array(-1, 'Create ZipFile object fail.'); if zipfile_.FilesCount() > 0 then zipfile_ := new ZipFile(); - [err, errmsg] := zipfile_.Open(alias, fname, passwd); + [err, errmsg] := zipfile_.Open(alias, TOfficeApi().CurCodePageToGBK(fname), passwd); if err=0 then Begin document_ := new docxDocument(zipfile_); End; @@ -87,7 +87,7 @@ Type TSDocxFile = Class ///返回: [err, info] Function SaveAs(alias, fname); Begin - return zipfile_.Save(alias, fname); + return zipfile_.Save(alias, TOfficeApi().CurCodePageToGBK(fname)); End; ///另存为二进制流数据 diff --git a/funcext/TSOffice/TSXlsxFile.tsf b/funcext/TSOffice/TSXlsxFile.tsf index ddc2e27..1532cb3 100644 --- a/funcext/TSOffice/TSXlsxFile.tsf +++ b/funcext/TSOffice/TSXlsxFile.tsf @@ -1,4 +1,4 @@ -// Version 1.5.8 +// Version 1.5.9 Type TSXlsxFile = Class ///Version: V1.0 2022-08-08 ///适用于 Microsoft Excel? 2007 及以上版本创建的电子表格文档。支持 XLSX / XLSM / XLTM / XLTX 等多种文档格式。 @@ -45,7 +45,7 @@ Type TSXlsxFile = Class Begin if not ifObj(zipfile_) then return array(-1, 'Create ZipFile object fail.'); if zipfile_.FilesCount() > 0 then zipfile_ := new ZipFile(); - [err, errmsg] := zipfile_.Open(alias, fname, passwd); + [err, errmsg] := zipfile_.Open(alias, TOfficeApi().CurCodePageToGBK(fname), passwd); if err=0 then InitVars(); return array(err, errmsg); End; @@ -96,7 +96,7 @@ Type TSXlsxFile = Class ///返回: [err, info] Function SaveAs(alias, fname); Begin - return zipfile_.Save(alias, fname); + return zipfile_.Save(alias, TOfficeApi().CurCodePageToGBK(fname)); End; ///真实文件名 diff --git a/更新日志.md b/更新日志.md index 9d4fd25..bd6c946 100644 --- a/更新日志.md +++ b/更新日志.md @@ -1,6 +1,10 @@ # 更新日志 -## 2023-1-18 +## 2023-1-31 + +### V1.5.9 + +修复`tsl`脚本格式为`utf8`时无法打开中文命名的文件 ### V1.5.8