D
D
Dima Kl2017-05-24 14:40:40
MySQL
Dima Kl, 2017-05-24 14:40:40

Problem with encoding in apache2 or mysql?

Good day.
There is a server on Ubuntu server 16.04
Installed Apache2, Mysql, Redmine
My task:
Get data from outside and transfer it to Redmine using a script written in python.
If the data is in English, there is no problem.
If it is in Cyrillic, then the word looks like this - test: {U+0442}{U+0435}{U+0441}{U+0442
} script), then everything is displayed as it should.
I looked into the redmine database, and saw the "wrong" Cyrillic alphabet is already being written there, i.e. something is not correctly transmitting data to the database, as I understand it.
The main question: Who is to blame for the "mangling" of the Cyrillic alphabet?
addition:
such a moment.
If I run my script with my hands, on the server side, then everything is written as it should be in Cyrillic.
And if the script starts automatically, after a certain condition is met, then there are "problems" with the Cyrillic alphabet.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dima Kl, 2017-05-26
@Listo4eg

uh... if anyone has a similar situation, then... I do
n't know why, but s = subprocess.check_output(['svn', 'log', '-r', 'HEAD', '/reps_folder/rep/rep ']) this line when called "automatically" returns the text in ascii encoding, BUT if we return in xml format, i.e. s = subprocess.check_output(['svn', 'log', '--xml', '-r', 'HEAD', '/reps_folder/rep/rep']) then everything is fine with utf-8 encoding

D
Dimonchik, 2017-05-24
@dimonchik2013

you check chardet,
convert it to utf8, and you drive everything in it,
if necessary - you do all sorts of urlencode when transferring over the network (usually you can do it yourself)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question