Is it still not advisable to use non Ascii letters in class names with 1.6?

I would like to be able to use European accented characters in class names.

Is it still not advisable to use non Ascii letters in class names with 1.6? Is it still not portable?

If so, why can't this be solved?

[230 byte] By [rigoloa] at [2007-11-27 11:50:00]
# 1

The problem is an organizational one, not due to any limitation of the language or tools. If you use anything but the basic ASCII characters in your code, you have to make sure the source files are saved with an encoding that supports those characters, and that the compiler uses the correct encoding to read them. If you're only going to be using one computer to work on the code, there's no problem; in fact, if the system default encoding supports the characters you're using, you won't even have to think about it. But the more people and computers that are involved the project, the more potential hassle there will be. And in an open source project you have no control at all over the contributors and the tools they use, so you have no choice but to limit yourself to 7-bit ASCII.

uncle_alicea at 2007-7-29 18:28:38 > top of Java-index,Desktop,I18N...
# 2

Me again (seems the login doesn't go through - I never got a confirmation email).

I get the impression that you are speaking about the source files (using non ASCII characters in Source file) rather than the class names (my concern) which impact the class files (the target rather than the source).

Is there a problem with my creating classes with French letters and distributing them as .class files, parts of jar files to other machines ? What will happen when a class called "terAccents" is created as terAccents.class and sent to a Chinese machine ?

Message was edited by:

rxOmega3

rxOmega3a at 2007-7-29 18:28:38 > top of Java-index,Desktop,I18N...
# 3

The Java Language Specification Chapter 3 has the following:

Except for comments (3.7), identifiers, and the contents of character and string literals (3.10.4, 3.10.5), all input elements (3.5) in a program are formed only from ASCII characters (or Unicode escapes (3.3) which result in ASCII characters). ASCII (ANSI X3.4) is the American Standard Code for Information Interchange. The first 128 characters of the Unicode character encoding are the ASCII characters.

http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#95413

ChuckBinga at 2007-7-29 18:28:38 > top of Java-index,Desktop,I18N...
# 4

Thank you ChuckBing.. But I'm not too sure what you mean by this quote.

Class names are identifiers so I imagine they can contain Unicode characters. I don't think there is a problem there (I can easily create classes names with accents on my machine).

The question has to do with a further point in the JLS.( 7.21.)

:"A package name component or class name might contain a character that cannot correctly appear in a host file system's ordinary directory name, such as a Unicode character on a system that allows only ASCII characters in file names. As a convention, the character can be escaped by using, say, the @ character followed by four hexadecimal digits giving the numeric value of the character, as in the \uxxxx escape (3.3), so that the package name:

children.activities.crafts.papierM\u00e2ch\u00e9

which can also be written using full Unicode as:

children.activities.crafts.papierMch

might be mapped to the directory name:

children/activities/crafts/papierM@00e2ch@00e9

If the @ character is not a valid character in a file name for some given host file system, then some other character that is not valid in a identifier could be used instead."

What worries me are all these conditionals (might be, could be). Is this actually working, are these recommandations actually implemented on enough machines so that using French accents in Classes names might be used and shipped around the world?

Anybody working for Sun on the forum?

rigoloa at 2007-7-29 18:28:38 > top of Java-index,Desktop,I18N...