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
2
u/morhp Professional Developer Dec 17 '25
Kinda, a character is a 16 bit value in UTF-16 encoding. This is enough to encode most unicode characters, but some special ones like emoji require two
charvalues together. This is called a surrogate pair.if you want to work with unicode code points, use ints and methods like
String.codePoints()