问题
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:
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 \[
.
来源:https://stackoverflow.com/questions/39620196/c-sharp-convert-unicode-chars