docker容器部署maven项目(utf-8)后,jsp有的页面中文乱码
作者:互联网
查看容器Id
[root@docker1 ~]# docker exec -it 41de9a0b6045 locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
发现LC_ALL=是空的
在Dockerfile中添加环境变量: ENV LC_ALL en_US.UTF-8
重启docker容器,查询locale:
[root@a9f82e7842c1 ~]#docker exec -it 41de9a0b6045 locale
LANG=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
问题解决,jsp页面不再乱码
标签:maven,en,utf,LC,US,乱码,POSIX,UTF,docker 来源: https://blog.csdn.net/qq_34004088/article/details/118421824