iTerm2 connection remote, Chinese garbled

The iterm2 terminal is used on the mac, and the shell environment is zsh. When I ssh to the Linux server to view some files, the Chinese characters are garbled. In this case, the character set of the terminal and the server do not match, and the default is utf8 character set under MacOSX.

The solution is as follows:
Enter locale to check the character encoding settings, and my corresponding value is empty. The default .zshrc is not set to utf-8 encoding, so the local and server sides must be set in .zshrc, the steps are as follows, (bash corresponds to the .bash_profile or .bashrc file).

1. Enter
vim ~/.zshrc

in the terminal

2. Add at the end of the file content:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

Then restart the terminal, or enter source ~/.zshrc to make the settings take effect. Connecting to the server, the Chinese display is normal.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5179 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.