如何将4位unicode转义序列转换为AutoIt中的实际符号
例如"\u00a5" to "¥"
答案 0 :(得分:4)
你是说这个?
#include <MsgBoxConstants.au3>
Local $sText = ""
For $i = 256 To 2048
$sText = $sText & ChrW($i) ; Or $sText &= ChrW($i) can be used as well.
Next
MsgBox($MB_SYSTEMMODAL, "Unicode chars 256 to 2048", $sText) ; Display the unicode characters between 256 to 2048.
或者这个:?
#include <WinAPI.au3>
Local $str = "My name is \u00a5"
Local $utfStr = Execute("'" & StringRegExpReplace($str, "(\\u([[:xdigit:]]{4}))", "' & ChrW(0x$2) & '") & "'")
Local $ansiStr = _WinAPI_WideCharToMultiByte($utfStr)
MsgBox(64, "Unicode2Ansi", $utfStr & @CRLF & $ansiStr)
Exit