r/javahelp • u/um_gato_gordo • Dec 17 '25
Is a char value Unicode?
like does it take Unicode characters?
3
Upvotes
r/javahelp • u/um_gato_gordo • Dec 17 '25
like does it take Unicode characters?
View all comments
11
u/MattiDragon Dec 17 '25
A char in java is one utf-16 thingy. It can encode any unicode codepoint except those that consist of a surrogate pair. If you need to deal with whole codepoints, use int. You also have to note that what seems like one character is often multiple codepoints in a grapheme cluster.