Re: [Dev-C++] How to find out code page in DOS Command Prompt
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Jan M. <jan...@vo...> - 2007-05-02 13:36:38
|
Hello,
thank you for the hint and the explanation.=20
I will try to find something on MSDN when I will feel ready to visit the =
page:-)
Jan Mura=20
----- Original Message -----=20
From: Per Westermark=20
To: Jan Mura=20
Cc: dev...@li...=20
Sent: Wednesday, May 02, 2007 11:29 AM
Subject: Re: [Dev-C++] How to find out code page in DOS Command Prompt
First of all system("") basically starts a new console for running the
command. I'm not sure if you can guarantee that the new environment
inherrits every characteristic from your application.
Second - the cp variable is not the answer for the chcp command. It is =
the
return value. In this case, a value of 0 means that the command =
executed
ok. It corresponds to the value you send to the function exit(), or =
the
return value when you leave the main() function.
When you use system() to run a command, that command will emit it's
answers to stdout - i.e. it will print the information. Not return it =
as
a value for system() to return.
Go to the Microsoft MSDN web site. They have a complete reference of =
the
Win32 API. There, you can find a huge amount of functions that you can
call directly from your code. Real functions, producing real answers.
There, you have a lot of information about current locale, code pages =
etc.
/pwm
On Wed, 2 May 2007, Jan Mura wrote:
> Hello,
>
> I would like to ask if there is a way to find out which code page
> iscurrently set for Command Prompt in Windows (I use XP Prof).
>
> I have tried to use somthing like
>
> ...
> cp =3D system("chcp");
> printf ("%d", cp);
>
>
> But there is always 0 in return value cp.
> The return values should be an implementation defined. So are they
> implemtented in Windows? Did I a mistake?
>
> Thank you.
>
> Jan Mura
> jan...@vo...
>
>
> =
-------------------------------------------------------------------------=
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|