本帖最后由 dbshy 于 2010-7-23 21:49 编辑
先找到那个简转繁的脚本
05.module Conv
06. def self.c(str)
07.
08. m2w = Win32API.new("kernel32","MultiByteToWideChar",'ilpipi','i')
09. w2m = Win32API.new("kernel32","WideCharToMultiByte",'ilpipipp','i')
10. lcms = Win32API.new("kernel32","LCMapString",'llpipi','i')
11.
12. len = m2w.call(65001,0,str,-1,nil,0)
13. buf = "\0"*(len*2)
14.
15. m2w.call(65001,0,str,-1,buf,len)
16.
17. len = w2m.call(0,0,buf,-1,nil,0,nil,nil)
18. ret = "\0"*len
19.
20. w2m.call(0,0,buf,-1,ret,len,nil,nil)
21.
22. len = m2w.call(936,0,ret,-1,nil,0)
23. buf01 = "\0"*(len*2+1)
24. lcms.call(0x0804,0x04000000,ret,-1,buf01,len*2)
25.
26. len = m2w.call(0,0,buf01,-1,nil,0)
27. buf = "\0" * (len*2)
28. m2w.call(0,0,buf01,-1,buf,len)
29.
30. len = w2m.call(65001,0,buf,-1,nil,0,nil,nil)
31. ret = "\0" * (len-1)
32. w2m.call(65001,0,buf,-1,ret,len-1,nil,nil)
33.
34. return ret
35.end
36.
37.end
24行 lcms.call(0x0804,0x04000000,ret,-1,buf01,len*2)
改为 lcms.call(0x0804,0x02000000,ret,-1,buf01,len*2) |