在PowerShell中,unescape unicode如何转义字符串?
$str1 = "http:\u002f\u002fgoogle.com\u002fsomething\u002ftest"
到
http://google.com/something/test
答案 0 :(得分:4)
执行此操作的代码是:
[Regex]::Replace($str1, "\\[Uu]([0-9A-Fa-f]{4})",
{[char]::ToString([Convert]::ToInt32($args[0].Groups[1].Value, 16))} )