This is a discussion on Letting C++ program show special characters such as æ, þ, ó within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by anon A side question, now that we have managed to display and perhaps input special characters, what ...
When I use CodePlug's wconbuf and pass this:
it displays the same character with the same value...Code:display_char(std::toupper(SMALL_LATIN_Ae, std::locale()));
I might be wrong.
Quoted more than 1000 times (I hope).Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
Where do I get a compiler for Code::Blocks that supports wide streams?
We already went over that one. Visual C++ supports wide streams and, indeed, Code::Blocks can use that compiler.
There may also be other ports of GCC that supports them, or other compilers, but Visual C++ is a no-slouch compiler. It is, in fact, a very good compiler.
Do you know of a website that tells me what is different in Visual C++ from Code::Blocks or something similar because I noticed some factors of coding were a bit different in Visual C++ than Code::Blocks?
Just to be clear, Visual Studio is the IDE and Visual C++ is the compiler.
Oh, you are free to use the IDE, if you want. It's my favorite IDE. But you can also set Code::Blocks to merely use the compiler, if you want. It supports wide streams.
And I cannot think that 1.8 GB of space is a problem for today's hard drives?
And I don't know what you mean with "different factors of coding"... They're the same language, and works in pretty much the same ways, the IDEs.
>> wouldn't I need a command to put in the program to change the font
Vista has a new API SetCurrentConsoleFontEx(). Prior to Vista there's not much you can do except to mess with the registry to make a console with a particular title use a particular font.
>> If it is MinGW then it might not support wide streams
The default STL implementation that comes with MinGW does not support wide streams. If you download and use STLPort, them you'll have wide stream support.
>> what does it take to make functions like toupper/tolower work with them?
You need a non-"classic" locale. For non-wide, the locale would also needs to be associated with the code page that contains the upper/lower of the character you're messing with. For wide chars, any non-classic locale seems to do the job in the MS-CRT.
Code:locale l("English_United States.1252"); display_char(SMALL_LATIN_Ae); cout << "std::toupper = "; display_char(std::toupper(SMALL_LATIN_Ae, l)); display_char(SMALL_LATIN_THORN); cout << "std::toupper = "; display_char(std::toupper(SMALL_LATIN_THORN, l)); display_char(SMALL_LATIN_O_wACUTE); cout << "std::toupper = "; display_char(std::toupper(SMALL_LATIN_O_wACUTE, l));>> Use the wide versions?Code:U+00E6 = æ std::toupper = U+00C6 = Æ U+00FE = þ std::toupper = U+00DE = Þ U+00F3 = ó std::toupper = U+00D3 = Ó
std::toupper is a template, so if you pass in wchar_t you're using wide.