luacom GetEnumerator 不好使?
来源:互联网 发布:java数组元素逆序 编辑:程序博客网 时间:2024/04/30 04:18
上一篇说了luacom不支持gbk,不过可以用iconv来解决,但是我还发现了一个问题,貌似 enumerator 不太好使
require "luacom"require "luaiconv"function createIconv(to, from)local cd = iconv.new(to, from)return function(txt)return cd:iconv(txt)endendL = createIconv("utf-8", "gbk")Z = createIconv("gbk", "utf-8")fs = luacom.CreateObject("Scripting.FileSystemObject")fd = fs:GetFolder("F:\\temp")fenum = luacom.GetEnumerator(fd.Files)f = fenum:Next()while f doprint(Z(f.Path))print(fs:FileExists(f.Path))f = fenum:Next()end
(上面的代码,改用luacom.pairs枚举也有同样问题)
这个代码假设 F:\temp下面有中文文件名的文件,发现 Z 函数对中文文件名文件,总是返回错误,而 Enumerator获得的路径名,直接判断是不是存在,居然是false!
这是什么问题呢,同样的方式,用javascript实现,完全没有问题啊。
求高手解答! bug??(本人实在不了解COM,没有勇气看luacom源代码)
- luacom GetEnumerator 不好使?
- GetEnumerator
- SQL为什么不好使
- CSDN一向不好使。
- f5刷新不好使
- bringSubviewToFront无效、不好使
- QSS debug好使release不好使
- 尝试一下看看好使不?
- IE下代理不好使!
- lpc1768的iap不好使
- opensuse after.local不好使
- OSX: PlistBuddy不好使了
- 腾讯导致document不好使
- hadoop put命令不好使
- Centos updatedb命令不好使
- js中的function(){}不好使
- RN 中setTimeout不好使
- SpringBoot1.5.6 actuator不好使
- pic2
- STC单片机11.0592晶振实现115200波特率串口通信
- 在项目中集成hibernate遇到的问题(2)
- MFC90D.dll vs
- android Application Component研究之Service
- luacom GetEnumerator 不好使?
- SDK方式下的退出窗口提示
- ubuntu 下,用户,文件夹,用户组 之理解
- 单片机C语言编程定时器的几种表达方式
- [Linux driver] Mutex, semaphore, spinlock的深度解析
- Android日记之2012/01/15
- 在VMware虚拟机中安装redhat linux操作系统图解
- 如何:使用 C++ 实现 C# 的 is 和 as 关键字
- acu解释器类C脚本代码