Hello Graham, What operating system variant/version are you on? > > For Linux systems I didn’t know any which actually preserved the purpose > of the envvars file. >
login as: rse rse@Alibaba's password: Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-61-generic i686) Furthermore the apache2.conf file says: # This is the main Apache server configuration file. It contains the # configuration directives that give the server its instructions. # See http://httpd.apache.org/docs/2.4/ for detailed information about # the directives and /usr/share/doc/apache2/README.Debian about Debian specific # hints. # # # Summary of how the Apache 2 configuration works in Debian: # The Apache 2 web server configuration in Debian is quite different to # upstream's suggested way to configure the web server. This is because Debian's # default Apache2 installation attempts to make adding and removing modules, # virtual hosts, and extra configuration directives as flexible as possible, in # order to make automating the changes and administering the server as easy as # possible. Then a bit further down: # PidFile: The file in which the server should record its process # identification number when it starts. # This needs to be set in /etc/apache2/envvars This is how I came to look at the envvars file and found the LANG directive. So, I tried and it worked. Hope this helps. Regards, René > Graham > > On 27 Aug 2015, at 11:50 pm, [email protected] <javascript:> wrote: > > Dear Graham, > > Thank you for all your inputs. I will definitively read all references you > gave. And I also bookmarked your blog. I didn't know you had one :-) > > In the meantime I found where it all comes from, made a small change and > now ... all works fine. > > Solution > ------------ > > There is a file /etc/apache2/envvars referred to by > /etc/apache2/apache2.conf. > In that file, I found the following lines: > > ## The locale used by some modules like mod_dav > export LANG=C > ## Uncomment the following line to use the system default locale instead: > #. /etc/default/locale > > As I don't need mod_dav, neither is it compiled with Apache2 ($apache2ctl > -l), neither is it loaded with Apache2 ($apache2ctl -M), I commented / > uncommented the 2 lines so that it now looks like: > > #export LANG=C > . /etc/default/locale > export LANG > > After a stop/start of Apache2, everything works fine and when I put the > code: > > from locale import getpreferredencoding > prefcoding = getpreferredencoding() > from os import environ > lang = environ["LANG"] > g = open('envresults', 'a') > g.write('LANG: ' + lang + '\n') > g.write('PrefCod: ' + prefcoding + '\n') > > in my WSGI application, it gives me the same as the interpreter: > > rse@Alibaba:~/test$ cat envresults > LANG: en_US.UTF-8 > PrefCod: UTF-8 > rse@Alibaba:~/test$ > > Thank you for your assistance. All the best. > Kind regards, René > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:>. > To post to this group, send email to [email protected] <javascript:> > . > Visit this group at http://groups.google.com/group/modwsgi. > For more options, visit https://groups.google.com/d/optout. > > > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/modwsgi. For more options, visit https://groups.google.com/d/optout.
