使用 ClipGet() 从剪贴板发送 unicode 字符
Sending unicode characters from the clipboard using ClipGet()
所以,目前我基本上是使用 Ctrl+C 复制文件夹的名称window 探险家。被复制的文本通常充满了 Unicode 字符。然后,我像这样使用 ClipGet()
:
$data = ClipGet()
Send($data)
不幸的是,ClipGet()
命令不能很好地使用 Unicode,所以我没有发送正确的文件夹标题,而是收到一堆 ?
字符。我真的不确定我应该如何处理 Send()
填充了 Unicode 字符的正确文本。
Clip get 完美运行。 Send() 是问题所在。
来自论坛
;======================================================
;
; Function Name: _SendUnicode("string")
; Description: Send a unicode or an ASCII string.
; Parameter(s): $string is the string you want to send.
; Requirement(s): String Input.
; Return Value(s): None
; Author(s): Robie Zhou (robiezhou@gmail.com)
;
;======================================================
Func _SendUnicode($string)
Local $char
Local $code
For $i = 1 to StringLen($string)
$char = StringMid($string, $i, 1)
$code = Asc($char)
If $code > 127 Then
$code = $code * 256
$i = $i + 1
$char = StringMid($string, $i, 1)
$code = $code + Asc($char)
EndIf
Send("{ASC " & $code & "}")
Next
EndFunc
所以,目前我基本上是使用 Ctrl+C 复制文件夹的名称window 探险家。被复制的文本通常充满了 Unicode 字符。然后,我像这样使用 ClipGet()
:
$data = ClipGet()
Send($data)
不幸的是,ClipGet()
命令不能很好地使用 Unicode,所以我没有发送正确的文件夹标题,而是收到一堆 ?
字符。我真的不确定我应该如何处理 Send()
填充了 Unicode 字符的正确文本。
Clip get 完美运行。 Send() 是问题所在。
来自论坛
;======================================================
;
; Function Name: _SendUnicode("string")
; Description: Send a unicode or an ASCII string.
; Parameter(s): $string is the string you want to send.
; Requirement(s): String Input.
; Return Value(s): None
; Author(s): Robie Zhou (robiezhou@gmail.com)
;
;======================================================
Func _SendUnicode($string)
Local $char
Local $code
For $i = 1 to StringLen($string)
$char = StringMid($string, $i, 1)
$code = Asc($char)
If $code > 127 Then
$code = $code * 256
$i = $i + 1
$char = StringMid($string, $i, 1)
$code = $code + Asc($char)
EndIf
Send("{ASC " & $code & "}")
Next
EndFunc