Escape string from file
<p>I have to parse some files that contain some string that has characters in them that I need to escape. To make a short example you can imagine something like this:</p>

<pre><code>        var stringFromFile = "This is \\n a test \\u0085";
        Console.WriteLine(stringFromFile);
</code></pre>

<p>The above results in the output:</p>

<pre><code>        This is \n a test \u0085
</code></pre>

<p>, but I want the text escaped. How do I do this in C#? The text contains unicode characters too.</p>

<p><strong>To make clear; The above code is just an example. The text contains the \n and unicode \u00xx characters from the file.</strong></p>

<p>Example of the file contents:</p>

<blockquote>
  <p>Fisika (vanaf Grieks, \u03C6\u03C5\u03C3\u03B9\u03BA\u03CC\u03C2,
  \"Natuurlik\", en \u03C6\u03CD\u03C3\u03B9\u03C2, \"Natuur\") is die
  wetenskap van die Natuur</p>
</blockquote>
