-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default lang/locale should be UTF-8, not ASCII. #156
Comments
I have written a blog about this problem before: |
Hmmm, Gunicorn seems to fail to do the right thing even when these environment variables are set.
Additionally setting Spin up |
This problem is only occurring with |
This goes beyond |
Solution is that also need to set environment variable:
This is as well as |
Closed via #167 |
for supervisor + gunicorn, can be config as below.
|
People are used to the default lang/locale of an operating system when using the command line being a variant of UTF-8. The consequence of this is that people often unknowingly use or try to output strings, using
print()
from a Python web application or module which contains character strings that are valid UTF-8, but which will fail if the default lang/locale is ASCII.When they try and deploy any code which does this to OpenShift it will fail when using recommended gunicorn, or if they roll their own web application as an
app.py
. For example:This problem doesn't actually arise with
mod_wsgi-express
because Apache/mod_wsgi has been susceptible to this sort of problem a long time as when Apache is run by Linux from system startup scripts it is often stripped of the default UTF-8 lang/locale the system otherwise runs as, and it runs with ASCII instead. As a consequence,mod_wsgi-expresss
corrects the situation to a more sane default so that users code doesn't keep blowing up all the time with the user not knowing why and then having to research what configuration changes they need to make.It would be much more friendly to developers if the default lang/locale for their deployed web applications were
en_US.UTF-8
. This should be hardwired into the Docker image itself by setting both theLANG
andLC_ALL
environment variables in theDockerfile
.They can still override this via the
.s2i/environment
file if they need to change it some other variant ofUTF-8
or other language.The text was updated successfully, but these errors were encountered: