Can't use special characters?

I want to be able to output special characters to a console in C++.
Some of the special characters include: ★, ∯, ♫, ♕, and so on.

When I output them to the screen, it actually turns out to be a "?".

How can I make it so it actually outputs what I want?
It depends on what encoding is being used. If It's UTF-8 you will need more than one char to represent those chars.
How do I know which encoding I'm using?

If It's UTF-8 you will need more than one char to represent those chars.


Actually, with UTF-8 a char will always be enough. UTF-16 would be problematic though.

As to console output: That has nothing to do with C++, the problem is that the windows console, at least as far as I know, only supports ASCII.
General advice regarding putting Unicode on consoles: don't. If you need Unicode or any other kind of representational cleverness, just use a GUI.
helios + 1
What's the difference between console and GUI?
And what is recommended?
closed account (3hM2Nwbp)
I would say that in the most broad sense, a console is an example of a GUI, but what's normally referred to as a GUI would be something more like notepad, vim, etc. There's no clear-cut recommendation for using a console versus a GUI, as it is all in relation to your solution. As helios and Duoas stated, if your aim is to display unicode, then a GUI would be the way to go.
Topic archived. No new replies allowed.