Omair Arif Omair Arif - 2 months ago 26
Java Question

Emojis' support in java (NetBeans)?

Im trying to make a program that reads some text from a .txt file, I want to count how many times a certain word was used.

The text however also has emojis included in it, Java prints these emojis as square brackets '[]' in the console when I print the line.

Is there anyway Netbeans can detect/support these emojis?
a few examples:
(

Answer

You are seeing squares (probably tofus) because you don't have a font able to render those characters. So the first step would be to ensure that you have such a font.

Even having a font able to render those characters doesn't mean that they will be correctly printed in the NetBeans console. This because the Emoji's are typically non-BMP codepoints (> 0xFFFF) thus encoded with 2 UTF-16 characters (

Comments