Please let me post the third update O_o. You can forgot other 2, i&#39;ll put them into this email.<div><br></div><div>---</div><div><div>&gt;&gt;&gt; s = &quot;ciao è ciao&quot;</div><div>&gt;&gt;&gt; print s</div><div>ciao è ciao</div>
<div>&gt;&gt;&gt; s.encode(&#39;utf-8&#39;)</div><div><br></div><div>Traceback (most recent call last):</div><div>  File &quot;&lt;pyshell#2&gt;&quot;, line 1, in &lt;module&gt;</div><div>    s.encode(&#39;utf-8&#39;)</div>
<div>UnicodeDecodeError: &#39;ascii&#39; codec can&#39;t decode byte 0xe8 in position 5: ordinal not in range(128)</div><div>---</div><div><br></div><div>I am getting more and more confused.</div><div><br></div><div>I was coding in PHP and was saving some strings in the DB. Was using utf8_encode to encode them before sending to the utf8_unicode_ci table. Ok, the result was that strings were &quot;double encoded&quot;. To fix that I simply removed the utf8_encode() function and put the &quot;raw&quot; data in the database (that converts them in utf8). In other words, in PHP, I can encode a string multiple times:</div>
<div><br></div><div>$c = &quot;giorgio è giorgio&quot;;</div><div>$c = utf8_encode($c); // this will work in an utf8 html page</div><div>$d = utf8_encode($c); // this won&#39;t work, will print a strange letter</div><div>
$d = utf8_decode($d); // this will work. will print an utf8 string</div><div><br></div><div>Ok, now, the point is: you (and the manual) said that this line:</div><div><br></div><div>s = u&quot;giorgio è giorgio&quot;</div>
<div><br></div><div>will convert the string as unicode. But also said that the part between &quot;&quot; will be encoded with my editor BEFORE getting encoded in unicode by python. So please pay attention to this example:</div>
<div><br></div><div>My editor is working in UTF8. I create this:</div><div><br></div><div>c = &quot;giorgio è giorgio&quot; // This will be an UTF8 string because of the file&#39;s encoding</div><div>d = unicode(c) // This will be an unicode string</div>
<div>e = c.encode() // How will be encoded this string? If PY is working like PHP this will be an utf8 string.</div><div><br></div><div>Can you help me?</div><div><br></div><div>Thankyou VERY much</div><div><br></div><div>
Giorgio</div>
</div>