 <p><code>\xa0</code> is <a href="http://en.wikipedia.org/wiki/Non-breaking_space" rel="nofollow">Non-breaking space</a> which is shown as a simple space in a web-page. Is code is <code>A0</code> which is outside of of ASCII range (0-127):</p> <pre><code>Python 2.7.6 (default, Mar 22 2014, 22:59:56) &gt;&gt;&gt; u'Rs.\xa05,000\n\r\n\t\t\t\t\t / -'.encode() Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 3: ordinal not in range(128) </code></pre> <p>So you have to manually replace it with a simple space, before encoding it to ASCII.</p> <p>Be default <a href="https://docs.python.org/2/library/stdtypes.html#str.strip" rel="nofollow"><code>str.strip</code></a> strips only whitespace, so you should manually strip chars <code>/ -</code>.</p> <p>This should work:</p> <pre><code>&gt;&gt;&gt; u'Rs.\xa05,000\n\r\n\t\t\t\t\t / -'.replace(u'\xa0', u' ').encode().rstrip('-/ ').strip() 'Rs. 5,000' &gt;&gt;&gt; </code></pre>