Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 23rd, 2005, 03:58 AM
Vinu
Guest
 
Posts: n/a
Default 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


  #2  
Old July 23rd, 2005, 03:59 AM
Ioannis Vranos
Guest
 
Posts: n/a
Default 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, 03:59 AM
Vinu
Guest
 
Posts: n/a
Default 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, 04:16 AM
Vinu
Guest
 
Posts: n/a
Default 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, 04:16 AM
Ron Natalie
Guest
 
Posts: n/a
Default 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.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.