Home  >  Article  >  Operation and Maintenance  >  What to do if ubuntu is garbled in docker

What to do if ubuntu is garbled in docker

藏色散人
藏色散人Original
2022-11-04 12:04:412254browse

Solution to ubuntu garbled characters in docker: 1. Check the local language environment through "locale"; 2. Check the local supported language environment through the "locale -a" command; 3. In "/etc/ Profile" file, add "export .UTF-8" at the end; 4. Reload "source /etc/profile".

What to do if ubuntu is garbled in docker

The operating environment of this tutorial: ubuntu18.04 system, Docker version 20.10.11, Dell G3 computer.

What should I do if ubuntu is garbled in docker?

Solving the problem of Chinese garbled characters in docker ubuntu

docker ubuntu18.04

Use cat to view Chinese Normal, use vim to view Chinese garbled characters.

To solve this problem, you need to modify the "/etc/profile" file.

1. Check the local language environment before modification:

locale

2. Check the local supported language environment:

locale -a

3. Then add "export LANG=C.UTF-8" at the end of the "/etc/profile" file

Edit the file:

  vim /etc/profile

Add export LANG=C.UTF-8

at the end Reload:

 source /etc/profile

4. Check the local language environment:

finished.

Recommended learning: "docker video tutorial"

The above is the detailed content of What to do if ubuntu is garbled in docker. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn