Decode or unescape \u00f0\u009f\u0091\u008d to

2019-04-08 16:56发布

We all know UTF-8 is hard. I exported my messages from Facebook and the resulting JSON file escaped all non-ascii characters to unicode code points.

I am looking for an easy way to unescape these unicode code points to regular old UTF-8. I also would love to use PowerShell.

I tried

$str = "\u00f0\u009f\u0091\u008d"
[Regex]::Replace($str, "\\[Uu]([0-9A-Fa-f]{4})", `
{[char]::ToString([Convert]::ToInt32($args[0].Groups[1].Value, 16))} )

but that only gives me ð as a result, not

1条回答
小情绪 Triste *
2楼-- · 2019-04-08 17:11

The Unicode code point of the

查看更多
登录 后发表回答