As I wrote the subject of this message, I got a cold feeling about this
question, I have realized that this is not only a programmer question,
but it is also a question about one the most detestable operation
systems in the market, but I will post it anyway, hoping that I will
not get fertilized by the any one here.
So, my question about a program that will display some text on the
console, not a big deal, the only thing is that the text displayed will
have some character that are not ASCCI; like the letter 'o' with two
dots on it or the letter 'ñ', (ALT-160/161/162, ETC). I don't have
much experience programming in MSW, thus I don't know how to handle
this problem.
Any help will be most appreciated.
TIA 6 1350
jalkadir wrote: ... So, my question about a program that will display some text on the console, not a big deal, the only thing is that the text displayed will have some character that are not ASCCI; like the letter 'o' with two dots on it or the letter 'ñ', (ALT-160/161/162, ETC). I don't have much experience programming in MSW, thus I don't know how to handle this problem.
Try this.
#include <stdio.h>
#include <stdlib.h>
int main()
{
system("chcp 437 > nul");
printf("%c %c %c \n", 160, 161, 162);
return 0;
}
...
jalkadir wrote: As I wrote the subject of this message, I got a cold feeling about this question, I have realized that this is not only a programmer question, but it is also a question about one the most detestable operation systems in the market, but I will post it anyway, hoping that I will not get fertilized by the any one here.
So, my question about a program that will display some text on the console, not a big deal, the only thing is that the text displayed will have some character that are not ASCCI; like the letter 'o' with two dots on it or the letter 'ñ', (ALT-160/161/162, ETC). I don't have much experience programming in MSW, thus I don't know how to handle this problem. Any help will be most appreciated.
TIA
You might be able to print wide unicode characters if you had a wide
stream for the cout. I don't know if it can handle this.
#include <iostream>
wchar_t ch = 0xC4;
std::cout << ch;
Doesn't print A umlaut on msys under Windows, and other than that, I
don't know of any way of printing to console.
There is no 'terminal' in standard C++. This is an OS specific issue,
and better addressed in an OS specific newsgroup.
--John Ratliff
jalkadir wrote: As I wrote the subject of this message, I got a cold feeling about this question, I have realized that this is not only a programmer question, but it is also a question about one the most detestable operation systems in the market, but I will post it anyway, hoping that I will not get fertilized by the any one here.
So, my question about a program that will display some text on the console, not a big deal, the only thing is that the text displayed will have some character that are not ASCCI; like the letter 'o' with two dots on it or the letter 'ñ', (ALT-160/161/162, ETC). I don't have much experience programming in MSW, thus I don't know how to handle this problem. Any help will be most appreciated.
TIA
I think replacing the gratuitous editorializing with an actual question
would have made a better use of those bytes. Yes, the C++ program can
send non-ASCII characters to the "terminal" (or more precisely, to
std::cout which is usually directed to a tty device). The character set
for these extended characters would by default be the Windows character
set which is practically identical to ISO-8859-1 -- a character set
which in turn is incorporated into Unicode. But why would the program
need to care? It outputs to std::cout and what anyone does with that
output is their business.
Greg
* jalkadir: So, my question about a program that will display some text on the console, not a big deal, the only thing is that the text displayed will have some character that are not ASCCI; like the letter 'o' with two dots on it or the letter '=F1', (ALT-160/161/162, ETC). I don't have much experience programming in MSW, thus I don't know how to handle this problem.
Not strictly on-topic, but since it's a potential showstopper for newbies,
<url: http://home.no.net/dubjai/win32cpptut/html/w32cpptut_01_02_06.html>.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
That is not the case in my Win console, when the character 'ñ' is sent
to the tty it is not displayed as a 'ñ' (alt-164) but as another
(non-letter) character. That is because, as far as I was explained; the
console in WinXP cannot handle other chars than ASCCI. However, this is
not true, because if I type ALT-164 directly to the console the letter
'ñ' is displayed.
If the win-console *does do its job as expected, when manually
inputting the data, as I explained above, then the problem exists
between the C++ code that is outputting data to the tty and the tty
itself, excuse the redundancy.
Well, thanks anyways, as I said in the original message; "Any help is
appreciated".
"jalkadir" <ja******@gosonic.ca> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com... a question about one the most detestable operation systems in the market,
Please keep your useless opinions off this newsgroup.
-Howard This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Max M |
last post by:
There is a story today on Slashdot
Open Source Project Management Lessons
======================================...
|
by: nospam |
last post by:
Reasons for a 3-tier achitecture for the WEB?
(NOTE: I said, WEB, NOT WINDOWS.
DON'T shoot your mouth off if you don't understand the difference.)
I hear only one reason and that's to switch a...
|
by: wired |
last post by:
Hi,
I've just taught myself C++, so I haven't learnt much about style or
the like from any single source, and I'm quite styleless as a result.
But at the same time, I really want nice code and I...
|
by: Sarah Tanembaum |
last post by:
Beside its an opensource and supported by community, what's the fundamental
differences between PostgreSQL and those high-price commercial database (and
some are bloated such as Oracle) from...
|
by: Dovelet |
last post by:
Hi all,
I would like to write DOS program to change the MS Windows Sound
Recording source. When I run it with the parameter, it will change the
recording source as follow:
C:\> abc.exe...
|
by: Joseph Casey |
last post by:
Greetings.
I have read that the mistake of calling free(some_ptr) twice on
malloc(some_data) can cause program malfunction. Why is this?
With thanks.
Joseph Casey.
|
by: Joel |
last post by:
Long and rambling question, here -- we have a customer with a database
that is outgrowing their original storage, and they want to upgrade
storage as cheaply and smoothly as possible.
Presently,...
|
by: Frank Millman |
last post by:
Hi all
I am writing a business/accounting application. Once a user has logged
in they are presented with a menu. Each menu option has a description
and an associated file name and program name....
|
by: DanielJohnson |
last post by:
int main()
{
printf("\n Hello World");
main;
return 0;
}
This program terminate just after one loop while the second program
goes on infinitely untill segmentation fault (core dumped) on...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
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...
| |