About Linux operating system terminal messy code perfect solution

  • 2020-05-12 06:41:16
  • OfStack

Programmers who are new to linux are often greeted with garbled code. It can be said that "the beginning of chaos eventually abandoned." There are many people who give up linux because of garbled codes. Well, to get to the point, let's look at how all kinds of messy code come into being.

Chinese characters are garbled

This situation is usually caused by installing the Chinese control terminal, but not enabling the Chinese application. Simply launch the appropriate software, such as zhcon. Or if the corresponding software is enabled, but the character set is not correct, the corresponding character set should be set, for example, export LANG= zh_CN.UTF-8

The ORACLE installation interface is garbled

Although ORACLE supports multiple languages and will automatically select the character set according to the environment variables, it seems that there is still a problem with the Chinese installation, but it seems that the version after 10.2 will not have this problem. You can execute the command export LANG=en_US to set the environment to the English character set

English characters are scrambled

Generally, this character chaos occurs in cat binary files, because there are more control codes in the binary files, which will lead to terminal interface chaos. Usually, the solution is to use reset terminal reset command to solve the problem

Other pseudo-terminal garbled code

Sometimes, when accessing the remote LINUX server through SSH, cat1 core file cannot be successfully used with reset command. What should I do? Very simple, look at the following experiment, first cat1 python compiled file

oracle@linux-suse:~ > cat fibo. pycm & # 63; {the & # 63; � c @ sdZdZdS (cCs: d}} x '| | jo | G | | |}} qWdS (Nii (ii (tatbtn (RRR ((tfibo. d pytfibscCsIg}}} x0 | | jo "| i | | | |}} qW | S (Nii (ii (tresultRRRtappend (RRRR ((Rtfib2 sN (RR (RR ((Rt & # 63; s oracle @ linux - suse: ~ > VT102VT102-bash: VT102VT102: command not foundoracle@linux-suse:~ >

On the SSH terminal, you can see the garble and the prompt is all garble. You can restore it with the following command

oracle@linux-suse:~ > tput sgr0

The reason for the garbled code problem is the problem of SSH, because in other terminals, cat will not produce garbled code with one file as a sample, so it will test the cause of garbled code

oracle@linux-suse:~ > ^N

Just use ctrl+v,ctrl+n and use the screen-scrambled code

oracle@linux-suse:~ > echo -e 'xe'

The screen is garbled again. Okay, let's go back

oracle@linux-suse:~ > echo -e 'xf'

The above is the need for blind typing, because what you see on the screen is garble code. The final cause of the problem is the base 106 character E. The solution is also very simple, the base 106 character F is enough.


Related articles: