<p>In a text file, there is a string "I don't like this".</p>

<p>However, when I read it into a string, it becomes "I don\xe2\x80\x98t like this". I understand that \u2018 is the unicode representation of "'". I use </p>

<pre><code>f1 = open (file1, "r")
text = f1.read()
</code></pre>

<p>command to do the reading.</p>

<p>Now, is it possible to read the string in such a way that when it is read into the string, it is "I don't like this", instead of "I don\xe2\x80\x98t like this like this"?</p>

<p>Second edit: I have seen some people use mapping to solve this problem, but really, is there no built-in conversion that does this kind of ANSI to unicode ( and vice versa) conversion?</p>

Actually, U+2018 is the Unicode representation of the special character ‘ . If you want, you can convert instances of that character to U+0027 with this code:
```
```
text = text.replace (u"\u2018", "'")
```
```
In addition, what are you using to write the file?
```
f1.read()
```
should return a string that looks like this:
```
```
'I don\xe2\x80\x98t like this'
```
```
If it's returning
this
string, the file is being written incorrectly:
```
```
'I don\u2018t like this'
```
```