views:

150

answers:

3

Hello, everyone!

The Character class in Java defines methods which check a given char argument for equality with certain Unicode chars or for belonging to some type category. These chars and type categories are named.

As stated in given javadoc, examples for named chars are
HORIZONTAL TABULATION, FORM FEED, ...;
example for named type categories are
SPACE_SEPARATOR, PARAGRAPH_SEPARATOR, ...

However, being byte or int values instead of enums, the name of these types are "hidden" at runtime.

So, is there a possibility to get characters' and/or type categories' names at runtime?

+4  A: 

Yes. Use ICU4J.

bmargulies
+1  A: 

The Character class supports category info. Look at Character.getType(char) for the category. But i do not think, you can get the character names.

Arne Burmeister
+1  A: 

The names are standard and may be used subject to certain limitations.

trashgod
Oh no, the copyright... I hope there will be no time when people will not be able to speak without accepting some "Unitalk" copyright license...
java.is.for.desktop
There are no limits on the use of these names in this sort of context. The UTC is happy to have anyone use them in this sort of case.
bmargulies
IIUC, the provisions are specified in Exhibit 1(a)(b)(c), cited above.
trashgod