Unicode Name For Any Code Point
Character.getName reports the official Unicode name of any code point, or null for unassigned ones, ideal for debugging odd glyphs.
Code
public class UnicodeNameLookup {
public static void main(String[] args) {
// Character.getName reports the official Unicode name of a code point
String input = "aΩ中ß";
input.codePoints().forEach(cp -> {
String name = Character.getName(cp);
System.out.println("U+" + Integer.toHexString(cp).toUpperCase()
+ " -> " + (name == null ? "(unnamed)" : name));
});
// unassigned code points yield null, so the page falls back to (unnamed)
int unassigned = 0x0378;
System.out.println("U+0378 -> " + Character.getName(unassigned));
// build the character back from its code point number
int snowman = 0x2603;
System.out.println("U+2603 -> " + Character.getName(snowman)
+ ": " + Character.toString(snowman));
}
}How it works
Unicode Name For Any Code Point is built around the class UnicodeNameLookup and the function main.
Applying it
The run emits 3 labeled sections — U+, U+0378 ->, U+2603 -> — one per step.
Statements that matter
String name = Character.getName(cp);
int unassigned = 0x0378;
String input = "aΩ中ß";
Interactive Tools for This Topic
Unicode Code Point ExplorerExplore Unicode code points of any text input. View each character with its code point, UTF-8 byte sequence, and official name for internationalization debugging.ASCII Table ReferenceLook up any ASCII code point 0-127 by decimal, hex, or character and see the binary, octal, and control-name view.Character Frequency AnalyzerCount how often each character appears in a text, with Unicode code points, optional case folding, and whitespace exclusion.CSS Color Name LookupTranslate between CSS keyword color names and hex values with RGB and HSL conversions, exact name matching, and nearest-color suggestions.
FAQ
- What does Unicode Name For Any Code Point print when run?
- Running the file directly is enough — expect labeled output lines such as `U+`, `U+0378 ->`, `U+2603 ->`.
Report a problem with this exampleOpens a pre-filled issue on GitHub.