Sorry for asking a stupid question, We are trying to print heart symbol from database to Java XML file. But the same is getting printed as "?" not sure where am I missing. Have tried the char unicode. As a practice I tried it using in main method. Please find the sample java class.
public static void main(String[] args) {
String t = "\u2665";
String myUnicodeSymbol = "\u05D0";
char hollowHeart = '\u2661';
String hollowDiamond = "\u2662";
String spade = "\u2660";
String club = "\u2663";
StringBuffer buffer = new StringBuffer("<HEAD>");
buffer.append("<HEART>").append(hollowHeart).append("</HEART>");
buffer.append("</HEAD>");
System.out.println(t);
System.out.println(buffer.toString());
}
The ouput is:- ? ?
Not sure what am I missing.