jupyterhub / the-littlest-jupyterhub

Simple JupyterHub distribution for 1-100 users on a single server
https://tljh.jupyter.org
BSD 3-Clause "New" or "Revised" License
1.03k stars 339 forks source link

Unicode encoding error when using tljh in other language env rather than English-env #410

Open wqh17101 opened 5 years ago

wqh17101 commented 5 years ago

My problem is that https://github.com/jupyterlab/jupyterlab/issues/6948

and i found the result that

https://github.com/jupyterhub/jupyterhub/issues/1902

So, as you say, i dont need to start tljh by jupyterhub -f XXX in the shell. How can i fix this problem.

when i start jupyterhub by jupyterhub -f XXX , this problem is resolved

wqh17101 commented 5 years ago

@GeorgianaElena i found that as a systemd service unit you can modify the service config to add the locale env. https://coreos.com/os/docs/latest/using-environment-variables-in-systemd-units.html Example: create a file named locale.conf, write something below to it

LANGUAGE="zh_CN.UTF-8"
LANG="zh_CN.UTF-8"
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"

modify the /etc/systemd/system/jupyterhub.service add EnvironmentFile=locale.conf to [Service]

service jupyterhub restart ,and it worked

Maybe we can add a locale.conf to the tljh-repo which can be modified by user and default is the configuration got by command "locale" and modify the tljh/systemed-units/jupyterhub.service add EnvironmentFile

Or we can add a env.conf for the systemed-service config