A system call exists in PHP such that
system("python3 returnUTF8.py")
If I run the Python script on the Linux command line - it works fine, however when I use the PHP system command I get an error "UnicodeEncodingError - can't encode to ascii"...
I understand the problem to be that the print function in Python defaults to the result the caller wants, and this is shown when I run print (sys.stdout.encoding) on the command line I get UTF-8 and from the system call I get ANSI_X3.4-1960.
How can I change the system call in PHP or the Python script to use UTF-8 encoding?