The following error was reported when deploying the project
[Java]View Plaincopyprint?
- java:[ 1 0 ] illegal character: \ 65279   
-
JAVA:[1,10] class, interface, or enum expected
the surface looked at the file is indeed true, do not see the problem, later from the SVN update the code after the discovery of local also do not error, and later through the Eclipse view the properties of the Xxx.java class, only to find the mystery:
Compile problematic file attributes: ( note the bottom line of Byte Order Mark is UTF-8 (BOM))
Compile the normal file properties:
It appears that the problem is on the Byte Order Mark is UTF-8 (BOM). Because you can't see the problem, open two files with UltraEdit and display them in 16 binary format:
Problematic file Header:
Problem-Free File header:
There seems to be a problem with the file header three bytes more than the EF BB BF.
The specific reasons are as follows:
Some editors add the UTF8 tag to the UTF8 file (EditPlus called it a signature), which inserts three invisible characters (0xEF 0xBB 0xBF, or BOM) at the beginning of the file, which represents a Unicode tag (BOM). So the key to solving this problem is to remove this markup option, which can be done as follows.
Mode one: first open this file with EditPlus, choose Permanet Settings from the Doucument menu, there are three categories, respectively, General,file, Tools. Click File, and the right side will be UTF-8 signature : Select Always remove signature. Click OK. The menu structure of the Chinese version of EditPlus is as follows: document, parameter settings, file->utf-8 signature, always remove signature, OK, so the UTF-8 format does not need to be marked in front of the file, Finally, save the file as Utf-8 format.
Mode two: Open Xx.java with notepad++, choose the format of the menu bar---to UTF-8 no BOM format encoding, save the submission
Related information, online excerpt:
 UTF-8 with byte encoding unit, no byte order problem. UTF-16 takes two bytes as the encoding unit, before interpreting a UTF-16 text, it is first to clarify the byte order of each coding unit. For example, the Unicode encoding for receiving a "Kui" is 594E, and the Unicode encoding for "B" is 4E59. If we receive the UTF-16 byte stream "594E", then is this "Kui" or "B"? The recommended method for labeling byte order in the Unicode specification is the BOM. The BOM is not a BOM for "Bill of Material", but a byte Order Mark. The BOM is a bit of a clever idea: there is a character called "ZERO WIDTH no-break SPACE" in the UCS encoding, which is encoded FEFF. Fffe is not a character in UCS, so it should not appear in the actual transmission. The UCS specification recommends that the character "ZERO WIDTH no-break SPACE" be transmitted before the byte stream is transmitted. This means that if the recipient receives Feff, the byte stream is Big-endian, and if Fffe is received, it indicates that the byte stream is Little-endian. So the character "ZERO WIDTH no-break SPACE" is also called a BOM. The UTF-8 does not require a BOM to indicate byte order, but it can be used to indicate the encoding using a BOM. The UTF-8 code for the character "ZERO WIDTH no-break SPACE" is the EF BB BF (readers can verify it with the coding method we described earlier). So if the receiver receives a byte stream beginning with the EF BB BF, it knows that this is UTF-8 encoded. Windows uses a BOM to mark the way a text file is encoded. The original BOM was added a few bytes at the beginning of the file as a marker.
Extended reading:
UTF-8, UTF-16, UTF-32 & Bom:http://www.unicode.org/faq/utf_bom.html#bom
Official Description: Http://www.w3.org/International/questions/qa-utf8-bom
java:[1,0] Illegal character: \65279 problem