What is the default encoding format of linux?

青灯夜游
Release: 2022-05-09 11:43:49
Original
8699 people have browsed it

The default encoding of Linux is "UTF-8" format, which can be viewed by executing the "locale" command in the terminal. The displayed result is ""LANG=en_US.UTF-8". If you want to modify the encoding Format, you can use the vi command to open the i18n file, modify the encoding value of the "LANG" item, and save the configuration.

What is the default encoding format of linux?

The operating environment of this tutorial: linux5.9.8 System, Dell G3 computer.

The default encoding for Windows is GBK, and the default encoding for Linux is UTF-8.

In Linux, we can use the locale command to Check the linux system encoding:

The language is en_US (American English), the encoding is UTF-8

What is the default encoding format of linux?

locale command is used to set the program to run Locale.

locale Set the naming rule of the locale to Language_area.charset. For example, en_US.utf8 means that the language is English, the region is the United States, and the character set is UTF-8.

Extended knowledge:

The Chinese edited under Windows is displayed as garbled characters under Linux. In order to solve this problem, modify the default encoding of Linux to GBK.

So what? Modify the default encoding of Linux? Here are several methods:

1. Manually modify the /etc/sysconfig/i18n file

vi /etc/sysconfig/i18n
Copy after login

to modify the default

LANG="en_US.UTF-8"
LANG="zh_CN.GB18030"
Copy after login

For:

LANG="zh_CN.GBK"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh"
Copy after login

2, vi /etc/profile

export LC_ALL="zh_CN.GBK"
export LANG="zh_CN.GBK"
Copy after login

Note: These two methods must be saved after modification.

Related recommendations : "Linux Video Tutorial"

The above is the detailed content of What is the default encoding format of linux?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template