How to automatically escape special characters in python but not the alphabetical ones?
<p>I'm writing with python, and I have a unicode containing special characters, such as double quotes and non english characters.</p>

<p>I want to automatically escape the special characters, but when I use re.escape it escapes all non english characters as well. I'm not sure that's supposed to happen.</p>

<p>Anyway this is problematic because when my python code writes javascript which has this unicode in it, the javascript prints an HTML element that has all these redundant slashes.</p>

<p>What am I doing wrong?</p>

<p>This is the resulting JS code:</p>

<pre><code>var myString='\ע\נ\ב\ר'
</code></pre>

<p>It should be</p>

<pre><code>var myString='ענבר'
</code></pre>

<p>UPDATE:
I used json.dumps(...), but it adds additional quotes before and after. Anyone Knows how to remove that?</p>
