•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 375,171 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,140 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser:
Views: 5170 | Replies: 7 | Solved
![]() |
•
•
Join Date: May 2006
Posts: 36
Reputation:
Rep Power: 3
Solved Threads: 1
I need to insert a "é" and other such symbols. At first I just tried using é straight out in C++ and it returned Θ. So I looked at my character map and did the unicode version \u00E9 where I wanted the é and it still returned Θ. I guess they are using two different standards. Can anyone point me to a list of such common special characters and their c++ encodings? My attempts at a google search have been inconclusive. Thanks :cheesy:
•
•
•
•
Originally Posted by CStallion
I need to insert a "é" and other such symbols. At first I just tried using é straight out in C++ and it returned Θ. So I looked at my character map and did the unicode version \u00E9 where I wanted the é and it still returned Θ. I guess they are using two different standards. Can anyone point me to a list of such common special characters and their c++ encodings? My attempts at a google search have been inconclusive. Thanks :cheesy:
using this code, the character é yields a value of -126 on my system
#include <iostream>
int main()
{
char c;
std::cin.get(c);
std::cout << static_cast<int> c;
}¿umop apisdn upside down? •
•
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 10,199
Reputation:
Rep Power: 34
Solved Threads: 824
I think you're c++ program will have to change fonts before beginning to output the text. The font used by the c++ console program is not the same font that the IDE editor uses. The IDE does not use cout or other console output functions to write to the window -- it uses win32 api functions. Don't know how to do that in console program.
•
•
•
•
So I try "\-126" and get a compile error. Any other ideas?
Just to re-iterate, this is not a C++ issue, this is an implementation-specific font issue. The windows 2000 cmd.exe console uses the "Terminal" font, hence why I got a value of -126 (or 0x82) for the 'é' character. if your implementation uses a different font, there's a strong possibility that the number -126 is not what you need (The code in my earlier post is indifferent to the font)
rambling aside - here is how you might print the é character, if your output uses the Terminal font.
#include <iostream>
int main()
{
char c = -126;
// you could also use 0x82 instead of -126
std::cout << c;
}#include <iostream>
int main()
{
std::cout << static_cast<char> (-126);
}You may also be able to change your IDE to use the same font as your console window, although I haven't tested that idea.
¿umop apisdn upside down? •
•
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 10,199
Reputation:
Rep Power: 34
Solved Threads: 824
•
•
•
•
Originally Posted by CStallion
Good! I changed my IDE font to the font "terminal" and then inserted the é straight out and everything worked fine. Thx!
What? I thought you wanted to see 'é', not that other character. When I did that with Dev-C++ it only made the IDE look like the console, not the other way around.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
Similar Threads
- Special characters with XSLT (RSS, Web Services and SOAP)
- i need help to convert characters (C)
- Special Character generation (Java)
- Handle unicode characters (Python)
- Inserting special characters & superscript (MySQL)
- Solaris 5.8-Unidetified file (*nix Software)
Other Threads in the C++ Forum
- Previous Thread: parse error, syntax error, wtf error?
- Next Thread: converting from float 2 integer



Linear Mode