There is a perl script that generates a picture from the text. The problem is that the script produces different results when it is launched from the Ubuntu console and launched via the exec () function. At the exit in the picture there are no Russian characters. What could it be?

  • 2
    Somewhere problems with encoding - Photon

2 answers 2

It is possible when running through exec () the script is executed under a different user with a different locale.

  • and how can I set this user's locale? - perseidsStarfall
  • See environment variable LANG - avp
  • It seems that I did not find anything like it. There is a file / etc / php5 / apache2 / envvars, there is something similar. Like me and the user, and variable LANG. Nothing happened. - perseidsStarfall
  • @perseidsStarfall, about LANG. I have avp @ avp-xub11 in my console: ~ / src / ig $ cat / etc / issue Ubuntu 04/12/1 LTS \ n \ l avp @ avp-xub11: ~ / src / ig $ echo $ LANG en_RU.UTF-8 avp @ avp-xub11: ~ / src / ig $ Are you empty? - avp
  • cat / etc / issue ubuntu 10.04.4 LTS \ n \ l echo $ LANG ru_RU.UTF-8 - perseidsStarfall

Most likely a problem in users and access rights. The php script is executed by another user who does not have access to fonts with Russian characters!