Can you use the recommended daemon mode of mod_wsgi and when doing so set the lang/locale to what you use.
See the lang/locale options in: https://modwsgi.readthedocs.io/en/master/configuration-directives/WSGIDaemonProcess.html <https://modwsgi.readthedocs.io/en/master/configuration-directives/WSGIDaemonProcess.html> You might see a difference in behaviour because a standard Linux Apache distribution doesn't set UTF-8 as the lang/locale which affects what happens in a WSGI application. For CGI, it may be seeing the correct locale as side effect of sub process/interpreter initialisation. There is no easy way to set correct lang/locale except by using daemon mode and setting those options. Only way to set it for embedded mode properly is to set it for the whole Apache instance. As quick alternative to test, try using mod_wsgi-express instead, as it will use daemon mode by default and set UTF-8 lang/locale for you. https://pypi.org/project/mod-wsgi/ <https://pypi.org/project/mod-wsgi/> Graham > On 18 Aug 2022, at 4:50 pm, '[email protected]' via modwsgi > <[email protected]> wrote: > > Hi, Thanks a lot for your fast response! > > The attached archive contains > the Apache Virtualhost configuration, > a sample Python3 WSGI script, and > a sample Python3 CGI script. > Calling the two scripts using curl produces the following output: > > $ curl https://testserver/test > WSGI: value of 'X_TEST': 0xc3 0x83 0xc2 0xa4 > $ curl https://testserver/cgi > CGI: value of 'X_TEST': 0xc3 0xa4 > > Thanks, Albrecht. > > Graham Dumpleton schrieb am Mittwoch, 17. August 2022 um 22:29:24 UTC+2: > Can you provide a simple WSGI hello world with some Python code showing how > you are checking this and what mechanism you are display it if you are? > > If you are looking at the Apache error logs to deduce this it can be > confusing because Apache does it's own encoding on values it gets and so what > you see in the logs isn't actually what the value may be. > > -- > 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] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/modwsgi/fe09f599-e2bc-40df-9613-12b5ead38d58n%40googlegroups.com > > <https://groups.google.com/d/msgid/modwsgi/fe09f599-e2bc-40df-9613-12b5ead38d58n%40googlegroups.com?utm_medium=email&utm_source=footer>. > <wsgi-env-issue.zip> -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/15C9B3D2-3ADB-484F-A5E6-DB4A1208793F%40gmail.com.
