You seem to be using Netbeans. The console in Netbeans uses a Monospace font by default, that is incapable of displaying Bangla characters.
You can switch to a different font from the context menu:
and then opt for displaying all the characters in the console using a font with the Bangla glyphs (I chose Arial Unicode MS, but you can choose any other Bangla font):
This would display the output that you desire:
Also, note the importance of the Netbeans project encoding:
Apparently, the console encoding happens to be the same as the project encoding; attempting to change this by setting the file.encoding
System property yields nothing. In this case, all UTF-8 encoded strings will be displayed without issues. However, if your file happens to be encoded with UTF-16BE/LE or any other encoding scheme, then the console will display gibberish/mojibake as it is impossible to change the terminal/console encoding on an as needed basis. In this case, the preferred approach is to store files in the same encoding as the project encoding, so that displaying their contents via System.out
will not result in displaying gibberish.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…