Answer the question
In order to leave comments, you need to log in
I execute python script from php using shell_exec function, it gives error 'ascii' codec can't encode?
Good afternoon!
I execute the command to run a python script from PHP (shell_exec, exec, system) the script gives an error: 'ascii' codec can't encode characters in position 0-8: ordinal not in range(128).
I execute the same command from the console - everything works. What can be a jamb?
Debian, Python3.4, PHP5.6.30
Not working.
shell_exec("in2csv import/21066634-44.7.8.xlsx > /tmp/21066634-44.7.8.xlsx.csv");
in2csv import/21066634-44.7.8.xlsx > /tmp/21066634-44.7.8.xlsx.csv
Answer the question
In order to leave comments, you need to log in
The issue was resolved. Found the answer in one of the comments on stackoverflow.com/questions/35437870/selenium-unic...
Before the command, add the locale setting: LANG=en_US.UTF-8 ;
shell_exec("LANG=en_US.UTF-8 ; in2csv import/21066634-44.7.8.xlsx > /tmp/21066634-44.7.8.xlsx.csv");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question