将4位unicode转义转换为实际符号



如何将4位unicode转义序列转换为AutoIt中的实际符号例如:"u00a5" to "¥"

你是这个意思?

    #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.

或this: Autoit中的特殊字符

或:?

#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

相关内容

  • 没有找到相关文章

最新更新