Print unique ascii characters in eclipse console
Kind of a strange question but... here it goes.
Recently my application threw an IOException that the text only had a clubs symbol in it (like the suit in cards) I know this is probably because there was a number in there that was cast to a char and printed to the screen, and I've found where that might have happened. The only problem is, I can't recreate it in eclipse because the eclipse console doesn't want to print those characters for me. All I get are boxes.
I figure this is an encoding issue or somethi开发者_如何学JAVAng but I need eclipse to print out those characters just like the windows console would. Is there a setting I can change to do this?
The respective Unicode character is U+2663. Just print "\u2663"
and you should be fine. This has nothing to do with ASCII, though.
If you get boxes it may also be a font issue. If the font you selected for the console view in Eclipse does not have a glyph for that code point you'll get boxes, usually. The character might still correctly printed, though. Usually monospaced fonts have that character, though, since it was historically part of the glyphs for the control characters below character code 32 (not that control characters ever had the intention of a visual appearance, but well, they could be in the screen buffer, so someone thought it would be a good idea to display them as well).
精彩评论