Utf8 engineering coding problems

Source: Internet
Author: User
Tags ultraedit
Problem description:

A JSP-based Web business project, charset of the page is declared as UTF-8, JB project is also declared as UTF-8 code, when using a JS file to store various districts and counties, the JSP page reports an error (no method in JS is called, but an error is reported when the JS file is included, and the "character is not terminated ). Incorrect display of Chinese characters using JB.


Later I found that the file encoding of this JS file is GB, not in the utf8 project. Therefore, you only need to open the JS file in JB that declares that the file encoding is not utf8 and re-enter all Chinese characters.
In addition, ultraedit has this conversion tool. Open this JS file in ultraedit and select "file"> "Conversion"> "ASCII to utf8" to complete the conversion, if there are other encoding conversions, there are still many options under this command menu.


Each file has a file encoding. By default, if we do not set the file encoding in IDE such as JB, the characters in any file are entered with the default local encoding, for example, the Chinese system is about GB, And if file encoding is set in IDE, the byte arrays of characters entered in the same input method are not exactly the same, the sample shows that the byte arrays of Chinese Characters in non-encoded files are different.

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.