D
D
digreen2010-10-08 11:23:48
Python
digreen, 2010-10-08 11:23:48

python, applying locale.setlocale

There are two hosts, one with server Ubuntu 10.04, the second with Linux Mint Rosinka 8.
There is a python script that parses html, sends data to the form with GET, and so on.
On the host with Ubuntu the script works, on the host with Mint it doesn't. for some reason, manipulations with Cyrillic characters no longer work.
The only important (IMHO) difference between the hosts is the locale:
LANG=ru_RU.UTF-8- on Mint
LANG=en_US.UTF-8- on Ubuntu
I tried to add it to the script on Mint , but to no avail. I'm not an expert in python, I chose it for that script just for the sake of interest. I barely defeated the Cyrillic alphabet on the Ubuntu server, and then such a fakap follows ... Maybe someone has come across something like this?
import locale
locale.setlocale(locale.LC_ALL, "en_US.UTF-8")

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kmike, 2010-10-08
@kmike

The script, therefore, is crooked, and it is more correct to repair it than to treat the symptoms. It is absolutely not normal when the script depends on the locale of the system, this is an obvious bug.
But although if “I’m not an expert in python, I chose it for that script just for the sake of interest.”, then I don’t know what to advise.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question