Can't use special characters?

Gldnbr (95)
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?
Peter87 (2052)
It depends on what encoding is being used. If It's UTF-8 you will need more than one char to represent those chars.
Gldnbr (95)
How do I know which encoding I'm using?
hanst99 (2700)

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.
helios (9442)
General advice regarding putting Unicode on consoles: don't. If you need Unicode or any other kind of representational cleverness, just use a GUI.
Duoas (6333)
helios + 1
Gldnbr (95)
What's the difference between console and GUI?
And what is recommended?
Luc Lieber (732)
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.