syntax errors in comments?

chris burdess dog@bluezoo.org
Tue Apr 15 19:36:00 GMT 2003


Joe Reid wrote:
> I'm getting a ton of "malformed UTF-8 character." errors compiling my 
> code.  Once I started digging in I realized all these errors were things 
> like copyright signs and at (@) signs in comments...all in comments.  If 
> I can't put an @ sign in my comments how can I build javadocs?  Why is 
> the compiler even reading the comments?

it might be a copyright sign, but it will not be an ampersand: the
latter is ascii.

you appear to have utf-8 as your charset encoding, but the files have
been created with some other encoding, perhaps iso-8859-1 or a windows
charset. these will not be valid utf-8, so you either need to convert
them, or set your charset to match the encoding of the files (set your
LANG environment variable).

the best policy is never to put characters higher than 126 unencoded in
your source. use the java encoding (\uxxxx) for any 8-bit characters in
java sources.
-- 
chris burdess



More information about the Java mailing list