Ubuntu System SSH Remote Server view Log display garbled problem solved

Source: Internet
Author: User

Native to Ubuntu system, Local System character encoding is:

Echo $LANG
Zh_cn. UTF-8

The character encoding for the remote server (121.199.42.27) is:

Zh_cn. GB18030

After logging on to the server via SSH, check the Catalina.out log in Tomcat and find that Chinese is garbled.

The following are the solutions:

    1. VI catalina.out
      : Set Termencoding=utf-8

    2. Tail,more and other viewing files garbled way to solve
      Tail Catalina.out | Iconv-f cp936-t Utf-8
      Note:-F represents the From
      -T indicates to

      How to view file encoding characters:
      VI catalina.out
      : Set
      You will see the following output:

Where fileencoding corresponds to the value is the current file encoding.

Resources:

http://blog.csdn.net/zwz_home/article/details/8273653



Ubuntu System SSH Remote Server view Log display garbled problem solved

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.