When performing table migration
<code>python manage.py inspectdb > example/models.py
</code>
<code>python manage.py inspectdb > example/models.py
</code>
python manage.py inspectdb > example/models.py
all Cyrillic strings are transposed as a set of unknown characters:
‘id_шёїюф ∙хую’
Encoding of the database server as well as python script is UTF-8.
Is there any way to solve this problem?
I tried
<code>show server_encoding;
</code>
<code>show server_encoding;
</code>
show server_encoding;
and got UTF8, tried
<code>set PYTHONIOENCODING=UTF-8
</code>
<code>set PYTHONIOENCODING=UTF-8
</code>
set PYTHONIOENCODING=UTF-8
Also, I added
<code>'OPTIONS': {
'client_encoding': 'UTF8',
}
</code>
<code>'OPTIONS': {
'client_encoding': 'UTF8',
}
</code>
'OPTIONS': {
'client_encoding': 'UTF8',
}
into settings.py.
All aforementioned methods didn’t help and problem is still existing.
I use psycopg package.
8