The ultimate solution for garbled Linux operating system terminals

Source: Internet
Author: User
Programmers who are new to linux often receive garbled greetings. It can be described as "starting from chaos ". Because of the garbled code, and finally gave up linux is not a minority. Well, let's get down to the truth. let's first look at how various types of garbled characters are formed. & Nbsp; Chinese character garbled characters & nbsp;

Programmers who are new to linux often receive garbled greetings. It can be described as "starting from chaos ". Because of the garbled code, and finally gave up linux is not a minority. Well, let's get down to the truth. let's first look at how various types of garbled characters are formed.

Chinese character garbled

In this case, the Chinese control terminal is installed, but the Chinese application is not enabled. You only need to start the corresponding software, such as zhcon. Or the corresponding software is enabled, but the character set is incorrect, you need to set the corresponding character set, such as export LANG = zh_CN.UTF-8

Garbled ORACLE installation interface

Although ORACLE supports multiple languages and automatically selects character sets based on environment variables, it seems that there are still problems with Chinese installation, but it does not seem to be a problem in versions later than 10.2, you can execute the command export LANG = en_US to set it to the English character set environment.

Garbled English characters

Generally, when this character is garbled more than a cat binary file, the terminal interface may be garbled because the binary file contains multiple control codes. the general solution is to use the reset terminal reset command to solve the problem.

Other pseudo terminal garbled characters

Sometimes, when a remote LINUX server is accessed through SSH, a core file is cat and the reset command cannot be used successfully. what should I do? It's easy. let's take a look at the following experiment. first, cat a python compilation file.

Oracle @ linux-suse: ~> Cat fibo. pyc
M?
{?? C @ sd
Zd
ZdS (cCs: d }}x | jo | G |||}} qWdS (Nii (ii (tatbtn (RRR (tfibo. pytfibs

CCsIg} d }} x0 | jo "| I |||}} qW | S (Nii (ii (tresultRRRtappend (RRRR (rtfiber 2 s)
N (RR (Rt? S oracle @ linux-suse: ~> VT102VT102
-Bash: VT102VT102: command not found
Oracle @ linux-suse: ~>
 
On the SSH terminal, we can see garbled code and prompt prompts are messy. you can use the following command to restore

Oracle @ linux-suse: ~> Tput sgr0
 
The cause of garbled text is SSH. in other terminals, cat uses a sample file without garbled text.

Oracle @ linux-suse: ~> ^ N
 
You only need to use ctrl + v and ctrl + n to use screen garbled characters. of course, try again after recovery.

Oracle @ linux-suse: ~> Echo-e xe
 
The screen is garbled again. OK, recover again.

Oracle @ linux-suse: ~> Echo-e xf
 
The above needs to be played blindly because garbled characters are displayed on the screen. The final cause of the problem is the hexadecimal character E, which is easy to solve. the hexadecimal character F is enough.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.