C# Convert Unicode chars [duplicate]

2019-07-24 23:20发布

This question already has an answer here:

is it possible to convert a string like "\u00e8" (Got it by reading a WebRequestResponse with Streamreader) to it's unicode char(è)? Tried many things with Encoding, but nothing works.

1条回答
乱世女痞
2楼-- · 2019-07-25 00:01

You can use Regex.Unescape(), which unescapes any escape sequences that are valid for a Regex (including \uXXXX). Note that it also unescapes other sequences like \t, \n, and \[.

查看更多
登录 后发表回答