473,807 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cout << "åäö"

Hi

I am playing around with visual studio 7.0.
Why does the code below do like it does?
Where do I set the character set to use in cout,
properties->configuratio n properties->General->character does not do
the trick.

#include <iostream>
using namespace std;
int main()
{
cout << "åäö";
}

output:
σΣ÷

expected output:
åäö
thanks!
Jul 22 '05 #1
4 5804

"karolina" <ra********@hot mail.com> wrote in message
news:c8******** *************** **@posting.goog le.com...
Hi

I am playing around with visual studio 7.0.
Why does the code below do like it does?
Where do I set the character set to use in cout,
properties->configuratio n properties->General->character does not do
the trick.

#include <iostream>
using namespace std;
int main()
{
cout << "åäö";
}

output:
σΣ÷

expected output:
åäö


[OT]
In windows open up a dos prompt window and type :
mode con
You should get information which tells you the DOS code page. (mine's is
850)

In the file menu within VC++ find the Advanced save options.
Save your file as ( in my case). Western European DOS - codepage 850 .
Your codepage should be listed there too if it is different from mine.

This should give you the expected output.

Additionally oven up character map in windows and select the check box for
advanced view , change the character set to the same as your DOS is using
and you will see what characters are compatable..

HTH
Jul 22 '05 #2
On 4 Dec 2003 14:10:56 -0800, ra********@hotm ail.com (karolina) wrote
in comp.lang.c++:
Hi

I am playing around with visual studio 7.0.
Why does the code below do like it does?
Where do I set the character set to use in cout,
properties->configuratio n properties->General->character does not do
the trick.

#include <iostream>
using namespace std;
int main()
{
cout << "åäö";
}

output:
σΣ÷

expected output:
åäö
thanks!


news:microsoft. public.vc.*. This is not a C++ language issue.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.l earn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
Jul 22 '05 #3
ra********@hotm ail.com (karolina) wrote in message news:<c8******* *************** ***@posting.goo gle.com>...
Hi

I am playing around with visual studio 7.0.
Why does the code below do like it does?
Where do I set the character set to use in cout,
properties->configuratio n properties->General->character does not do
the trick.

#include <iostream>
using namespace std;
int main()
{
cout << "åäö";
}

output:
σΣ÷

expected output:
åäö
thanks!


I expect you're swedish, so I'll write in swedish. ;)

Du måste skriva dessa tecken med ascii-kod, så att istället för att
skriva

cout<<"Jag är på en ö";

så skriver du

cout<<"Jag \x84r p\x86 en \x94";

å = \x86
ä = \x84
ö = \x94

förstår du?
om inte får du maila.
la********@hotm ail.com
Jul 22 '05 #4
"Lars T?rnqvist" <la********@hot mail.com> wrote...
ra********@hotm ail.com (karolina) wrote in message

news:<c8******* *************** ***@posting.goo gle.com>...
Hi
[...]
thanks!


I expect you're swedish, so I'll write in swedish. ;)
[...]


Please consider that the majority of readers in this newsgroup
are not Swedish, and out of them, most cannot read Swedish. If
your answer could be of any interest to them, the form in which
it was presented made it impossible to use.

If you think that your answer is NOT interesting to the rest of
the newsgroup readers, use private e-mail, please. Otherwise,
perhaps next time you will be so kind as to supply an English
translation of what you have to say.

Thank you very much.

Victor

Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
1501
by: qazmlp | last post by:
I hope comp.lang.c will not find the following question as a complete off-topic. I would like to remove ie.comment out the 'cout' statements during compilation(actually preprocessing) time. The statements like this: cout<<"something\n" ; should be made as
6
21076
by: Omid | last post by:
Hi. I have problems when I try to redirect everything that is sent to cout to a file. I have one piece of code that works and one that does not work. The only difference is which headers I use. What the code does: * First writes "This is sent to prompt" to prompt.
5
4009
by: Mastupristi | last post by:
I want to obtain the c++ equivalent of: unsigned short us = 347; printf("0x%04hX",us); that outputs "0x015B" I ried with: cout.setf(ios_base::hex,ios_base::basefield);
10
3518
by: Gurikar | last post by:
How to make cout not printing on the console. i mean void main() { cout<<"Hello world"<<endl; } Is there any way where i can block printing on console even when iam
7
7574
by: Joe C | last post by:
I'd like to have better control of text output to the console. I'm using Windows and have a little (non-standard) function to help me out: #include <windows.h> void locate(int x, int y ) { COORD cur = { x, y }; SetConsoleCursorPosition( GetStdHandle( STD_OUTPUT_HANDLE ), cur ); }
16
3996
by: mrDumbass | last post by:
#include <iostream> #include <algorithm> #include <string> #include <fstream> using namespace std; /* i would like to keep the numbers of the output : Power , step etc, on the same place in the console. But this isnt going to work with
2
8870
by: Generic Usenet Account | last post by:
What exactly is the difference between the hex manipulator and the following statement: cout.setf(ios_base::hex)? According to Stroustrup, Third Edition, Section 21.4.4, "once set, a base is used until reset". For some reason, I interpreted this to mean that "<< hex" manipulator would cause the base to be set for only the current statement, while the cout.setf(ios_base::hex) statement would cause the base to be set for multiple...
3
2555
by: shk253 | last post by:
Hi all - I'm trying to generate a payroll. I'm having trouble with the cout statements overwriting the previous inputs, e.g. enter info for employe 1: blah blah blah. Enter info for employee 2: blah blah blah... When I generate the report, only information for employee 2 appears. I can see why this would happen from looking at my code... I would appreciate it if someone could let me know how to modify the code so that I could print out the...
58
4866
by: Mark Casternoff | last post by:
I'm getting back into C++ after a long hiatus (they didn't have namespaces back then). I know this question is completely subjective, but I'd be interested in hearing which is the "better" style and what the pros and cons are (I'm using cout as example, but it really applies to any similar construct): 1) using std::cout;
1
1271
by: William Chavula | last post by:
void basic() { cout<<"---FOLLOW THESE STEPS TO DIAGNOSE INTERNET PROBLEMS---\n\n"; cout<<"---STEP 1---\n\n"; cout<<"Run your mobile partner software\n\n"; cout<<"---STEP 2---\n\n"; cout<<"Click on TOOLS in the menu bar\n\n"; cout<<"---STEP 3---\n\n"; cout<<"In the tools menu click on PROFILE MANAGEMENT\n\n";
0
9720
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9599
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10626
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3854
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.