Unicode characters string

If you really don’t control the string, then you need to replace those escape sequences with their values:

Regex.Replace(s, @"\u([0-9A-Fa-f]{4})", m => ((char)Convert.ToInt32(m.Groups[1].Value, 16)).ToString());

and hope that you don’t have \\ escapes in there too.

Leave a Comment