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

V

Vinu

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
 
I

Ioannis Vranos

Vinu said:
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 .


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.
 
V

Vinu

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
 
R

Ron Natalie

Vinu said:
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 .
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top