怎么把下方vbs代码,改成批处理命令,支持变量输入输出呢?- s = "𪚥"
- WScript.Echo Hex(ToCodePoint(s))
-
- 'return code point of a character
- Function ToCodePoint(s)
- Dim uni, uni2
- uni = CLng("&H" & Hex(AscW(s)))
- If (uni >= &HD800&) And (uni <= &HDBFF&) Then
- uni2 = Mid(s, 2, 1)
- If uni2 = "" Then
- Err.Raise 8732, "ToCodePoint", _
- "Invalid surrogate pair"
- End If
- uni2 = CLng("&H" & Hex(AscW(uni2)))
- uni = &H10000 + (((uni - &HD800&) * 2 ^ 10) Or (uni2 - &HDC00&))
- End If
- ToCodePoint = uni
- End Function
复制代码
|