A
A
Andrey2016-09-22 13:15:37
Django
Andrey, 2016-09-22 13:15:37

Change text encoding when uploading to server?

I upload files to the server (it doesn't matter if it's .html or .py) - in the files, all Cyrillic characters change the encoding from utf-8 to windows-1251 and look something like this "ОткудР".
In html files I charset utf-8also specify in python # -*- coding: utf-8 -*-
But this does not help. I tend to think that some changes were made in the server settings, because before that everything worked ok.
Nginx installed.
Guys, tell me which way to dig?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey, 2016-09-22
@andreysharypov

I found the reason for changing the encoding - in WinSCP, in settings / editors / built-in, there was windows-1251. Changed to utf-8 and now everything is ok when uploading to the server.

D
Dmitry, 2016-09-22
@slo_nik

Good afternoon. If the server is apache2, then add the line AddDefaultCharset UTF-8
in the root of the site, in .htaccess

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question