Convert a Unicode string to an escaped ASCII string

Viewed 119670

How can I convert this string:

This string contains the Unicode character Pi(π)

into an escaped ASCII string:

This string contains the Unicode character Pi(\u03a0)

and vice versa?

The current Encoding available in C# converts the π character to "?". I need to preserve that character.

9 Answers
Related