[PYTHON] What to do if mod_fcgid cannot resolve UnicodeEncodeError

I'm running Django with mod_fcgid and Apache

UnicodeEncodeError: 'ascii' codec can't encode characters

What to do if you get the error.

You need to add the following line to httpd.conf.

FcgidInitialEnv LANG "ja_JP.UTF-8"

"Source" https://code.djangoproject.com/ticket/17686 "django wouldn't get the locale settings of my user. In fact the fcgi script wouldn't, even if my envvars script was properly configured."

As you can see, for some reason setting it with envvars etc. has no effect. .. .. Setting "ja_JP.UTF-8" in an environment variable such as LC_ALL did not work. ..

There was no problem with mod_wsgi. .. .. I spent hours finding this information.

Recommended Posts

What to do if mod_fcgid cannot resolve UnicodeEncodeError
What to do if pip cannot be installed
What to do if PyAudio cannot be installed on Python 3.7, 3.8, 3.9 on Windows
What to do if pipreqs results in UnicodeDecodeError
What to do if you can't pipenv shell
Note: What to do if pip install fails
What to do if rails s doesn't work
What to do if atom autocomplete-python doesn't work
What to do if Docker-sync suddenly stops working
What to do if "amazon-linux-extras" → "No module named amazon_linux_extras"
What to do if pip install fails in Xcode 5.1
What to do if you can't pip install mysqlclient
No module named What to do if you get'libs.resources'
ModuleNotFoundError: No module What to do if you get'tensorflow.contrib'
What to do if SciPy installation fails on CentOS
What to do if a UnicodeDecodeError occurs in pip
What to do when "cannot import name xxx" [Python]
What to do if pip install fails to install dependent libraries
What to do if sys / cdefs.h does not exist
What to do if pyenv is not enabled (zsh)
What to do if pvcreate produces a lot of WARNING and cannot be created
What to do if you are addicted to Windows character code
What to do if pip gives a DistributionError in Homebrew
What to do if you get "coverage unknown" in Coveralls
What to do if you can't sort files with subscripts
What to do if a 0xC0000005 error occurs in tf.train.start_queue_runners ()
What to do if package installation fails when deploying to heroku
What to do if `pip install matplotlib` fails on Mac
What to do if you can't log in as root
What to do if you can't use WiFi on Linux
What to do if Linux VLC can no longer rotate
What to do if pip install mysqlclient fails on MacOS
What to do if you lose your EC2 key pair
[* CentOS 6.10] What to do if you cannot add the IUS Community Project repository on CentOS 6.5 (VirtualBox)
What to do if you get a Cannot retrieve metalink for repository error in yum
What to do if ʻObject arrays cannot be loaded when allow_pickle = False` occurs in numpy.load ()
What to do when Ubuntu crashes
What to do with Magics install
What to do with PYTHON release?
What to do to get tensorflow-gpu to work
What to do if you can't install pyaudio with pip #Python
What to do if you get a minus zero in Python
What to do when a video cannot be read by cv2.VideoCapture
What to do if intellisense doesn't work with Anaconda + VSCode + Tensorflow2.1
What to do if python says "fatal error:'stdio.h' file not found"
What to do if you get a UnicodeDecodeError with pip install
What to do if Insecure Platform Warning appears when running Python
What to do if "Unnamed: 0" is added in to_csv-> read_csv in pandas
What to do if the inode is exhausted on EC2 Linux
What to do if you can't build your project with Maven
What to do if you can't use the trash in Lubuntu 18.04.
Django: What to do if TemplateDoesNotExist at / admin / after setting templates
What to do if grep: empty (sub) expression appears on Mac grep
What to do if you get an error saying c compiler cannot create executables in configure
Workaround if you cannot add to LD_LIBRARY_PATH
What to do if you can't find well with grep's -f option
What to do if there is a decimal in python json .dumps
What to do if you can't find PDO in Laravel or CakePHP
What to do if the Pipenv environment is corrupted by updating Homebrew
What to do if you couldn't send an email to Yahoo with Python.
What to do if you can't use scikit grid search in Python