I am developing a card game in Java and I am currently using a command line to interact and display outputs of the game. I have been representing each card suit with A letter (H - Hearts, S - Spades etc.)
I came up with the idea of using the Unicode values rather than letters to show each suit
public String toSymbol(Suit suit){
switch(suit){
case SPADE:
return "\u2664";
case DIAMOND:
return "\u2662";
case CLUB:
return "\u2667";
case HEART:
return "\u2661";
default:
return "null";
}
}
My issue is that when trying to print these symbols they simply display our favourite Unknown Character '?'. I read that this could be due to the byte stream System.out.println() uses something too short? Instead I should use a Print Writer.
I tried this and still no results. Could it be to do with the format my commandline uses?