Python: reading '\xc2' from file prints fine but printing string variable with same value fails
<pre><code>    with open(path) as f:
        for line in f:
            print line
</code></pre>

<p><code>path</code> is file with single line as <code>\xc2</code></p>

<p>when I run this I get </p>

<p><code>\xc2</code></p>

<p>now lets change this</p>

<pre><code>with open(path) as f:
    for line in f:
                var = '\xc2'
                print var
</code></pre>

<p>When I run this, I see  </p>

<pre><code>UnicodeDecodeError: 'ascii', '\xc2d', 0, 1, 'ordinal not in range(128)'
</code></pre>

<p>then I try to compare the so I do</p>

<pre><code>with open(path) as f:
    for line in f:
        line = line.strip()
        line1 = '\xc2d'
        # print line1
        print line == line1
</code></pre>

<p>and I see <code>False</code></p>

<p>What is happening here??</p>
