How does Android logcat output Chinese characters?

Source: Internet
Author: User

1. Output tag

ADB logcat-S system. Out: or ADB logcat login my myname *: s multi-flag

2. Output location

ADB logcat> F:/1.txt

Android logcat output is UTF-8 encoding, to correctly display Chinese, you need to set the encoding settings in the Windows cmd window, the following is the setting steps.

1. Open the cmd.exe command line window
2. Use the chcp command to change the code page. The code page of The UTF-8 is 65001.
F: \ trash>Chcp 65001 
After this operation is performed, the code page is turned into a UTF-8. However, UTF-8 characters still cannot be correctly displayed in the window.

3. Modify window properties and font
Right-click the command line title bar and choose"Property"-> "font", Change the font to True Type Font"Lucida Console", And then click OK to apply the property to the current window.
4. the above operations cannot completely solve the problem, because the displayed content may be incomplete. The command line window can be minimized first, and the file content is displayed completely.

Use of logcat
[ADB] logcat [<option>]... [<filter-spec>]...
The filter statement depicts the tag in the following format: priority ..., tag indicates a tag, and priority indicates the lowest level of a TAG report. the log priority can be obtained from the above tag. you can write the tag: Priority multiple times in the filter.

ADB logcat activitymanager: I MyApp: D *: S 
The last element *: s of the above expression is to set all labels as "silent", and all logs only show "View" and "MyApp". Use *: another use of S is to ensure that the log output is restricted according to the description of the filter, and make the filter output to the log as an item.


To restore to GBK, just enter "chcp" in cmd.
936 "press Enter;

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.