Android Studio Error Utf-8+bom Solution

Source: Internet
Author: User
When I ran a program with Android studio today, I suddenly reported a mistake I'd never seen before:

Then I clean and build, the results are not good, the program is still an error, I consulted the great god around, the result has not seen this wonderful situation, and finally through the online solution and its own summary, is a set of perfect solution.

Error reason, code coding format error, we usually use UTF-8 format, the reason for this error, because the encoding format into the Utf-8+bom format, and previously we write the Android program is written in Eclipse, Eclipse can automatically put utf-8+ The BOM format is converted to UTF-8 format, and Android Studio does not have this functionality. So this kind of mistake is not common.
First: Open the Android studio settings, the encoding format is all set to UTF-8 format, now you can try whether also reported wrong, my result is still not resolved.
Second, we need Third-party software, where we use EditPlus to demonstrate the solution. After installing EditPlus, open the software, then open the error in the Java file, in the menu bar click Document Command, select File Encoding--convert Encoding, as shown:

The Convert Encoding dialog box pops up and we can see that the encoding format is Utf-8+bom, and then we'll change it to UFT-8, as shown in figure:

Go to Android Studio and run the program, no more errors.

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.