本帖最后由 lainline 于 2010-2-11 21:54 编辑
写了两个简单的自定义函数#include <Misc.au3>
Local $fTest
$fTest = _ClipPutFile(_ANSI_FIX(@ScriptFullPath & "|" & @ScriptDir & "|" & @SystemDir))
MsgBox(0,"_ClipPutFile()","Content of Clipboard:" & @CRLF & ClipGet())
MsgBox(0,"2",_ANSI_StringLen("你好"))
Func _ANSI_FIX($UN_FIX_TEXT);修复汉字计算字符数引起的字符截断问题,用于ClipPutFile
Local $temp= $UN_FIX_TEXT
Local $cnTEXTnumber = BinaryLen (StringToBinary($temp,4))-StringLen($temp)
If $cnTEXTnumber>0 Then
For $i=1 To $cnTEXTnumber
$temp &= "|"
Next
EndIf
Return $temp
EndFunc
Func _ANSI_StringLen($text) ;返回字符实际占用数,某处代替StringLen()
Return BinaryLen (StringToBinary($text,4))
EndFunc
|