Connecting Tech Pros Worldwide Help | Site Map

int main(int argc, wchar_t* argv[]) using gcc 3.4.2 .

  #1  
Old July 23rd, 2005, 04:58 AM
Vinu
Guest
 
Posts: n/a
hi
How can i accept unicode char in command line. The application on
Solaris Sparc expects wide characters for its processing

Can you suggest standard way of doing it on Sun Solaris Sparc? We are
using gcc 3.4.2 .

Thanks
Vinu

  #2  
Old July 23rd, 2005, 04:59 AM
Ioannis Vranos
Guest
 
Posts: n/a

re: int main(int argc, wchar_t* argv[]) using gcc 3.4.2 .


Vinu wrote:
[color=blue]
> hi
> How can i accept unicode char in command line. The application on
> Solaris Sparc expects wide characters for its processing
>
> Can you suggest standard way of doing it on Sun Solaris Sparc? We are
> using gcc 3.4.2 .[/color]


Use wchar_t (built in type), wcin and wcout (<iostream>) inside the application.


Now there is no standard way for receiving wchar_t from the command line. You will have to
use a system extension for that.

A standard work-around way could be to enter the arguments not from the command line but
from inside the application by using wcin. For example instead of the user entering

../whatever -p he would do:


the program will prompt for them:

../whatever

Please insert parameters:


Just a thought anyway.


--
Ioannis Vranos

http://www23.brinkster.com/noicys
  #3  
Old July 23rd, 2005, 04:59 AM
Vinu
Guest
 
Posts: n/a

re: int main(int argc, wchar_t* argv[]) using gcc 3.4.2 .



i want a main like this
int wmain(int argc, wchar_t* argv[])

  #4  
Old July 23rd, 2005, 05:16 AM
Vinu
Guest
 
Posts: n/a

re: int main(int argc, wchar_t* argv[]) using gcc 3.4.2 .




hi
How can i accept unicode char in command line. The application on
Solaris Sparc expects wide characters for its processing


Can you suggest standard way of doing it on Sun Solaris Sparc? We are
using gcc 3.4.2 .


Thanks
Vinu

  #5  
Old July 23rd, 2005, 05:16 AM
Ron Natalie
Guest
 
Posts: n/a

re: int main(int argc, wchar_t* argv[]) using gcc 3.4.2 .


Vinu wrote:[color=blue]
>
> hi
> How can i accept unicode char in command line. The application on
> Solaris Sparc expects wide characters for its processing
>
>
> Can you suggest standard way of doing it on Sun Solaris Sparc? We are
> using gcc 3.4.2 .
>
>[/color]
I suspect it's less a GCC issue than a Solaris OS issue. Most of
the Sun OS's I've used that could handle Unicode at all have UTF-8
(that is, multibyte 8-bit) representations for Unicdoe on all the
system interfaces (program arguments, file names, ...). This is
fine because C++ is defective in defining wchar_t interfaces for
everything that needs them anyhow.

Use the " main(int, char**)" main signature and convert from
multibyte to wchar_t in main.
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
main(int argc, wchar_t *argv[]) on linux i386 (redhat) interec@interec.net answers 4 March 24th, 2007 09:35 AM
how i can print the values of argv[] under unix environment.Plz help me Vinu answers 13 November 14th, 2005 10:19 PM
wcout' is not a member of `std' jalkadir answers 7 October 10th, 2005 03:35 PM
Problem with inheritance Victor Chew answers 12 July 19th, 2005 04:57 PM