Python 2.7 connection to Oracle: loosing (Polish) characters
<p>I connect from Python 2.7 to Oracle data base.
When I use:</p>

<pre><code>cursor.execute("SELECT column1 FROM table").fetchall()]
</code></pre>

<p>I have got almost proper values for column1 because all Polish characters ("ÄÃ³ÄÅÅÅ¼ÄÅ") are converted to ascii one ("eoaslzcn"). Using another tool like SQLDeveloper and using the same select statement I get proper value.</p>

<p>@Mark Harrison - thank you very much ! It works! There is an exact instruction what I did:</p>

<p>I checked in Oracle what is the language:</p>

<pre><code>SELECT USERENV ('language') FROM DUAL
</code></pre>

<p>The response was:</p>

<pre><code>POLISH_POLAND.UTF8
</code></pre>

<p>Then I changed NLS_LA value in Python:</p>

<pre><code>os.environ['NLS_LANG'] = 'POLISH_POLAND.UTF8'
</code></pre>

<p>Using</p>

<pre><code>print "%s, %s" % (name, surname)
</code></pre>

<p>and "> file.txt" in command line I obtained a (proper) file in utf8.</p>

python oracle python-2.7 character-encoding polish