Does main function Unicode?

S

Samant.Trupti

Hi,

Does main function support unicode?
int main( int argc, char** argv ) can I say int mainw( int argc,
wchar_t** argv )?

Thanks
Trupti
 
J

James Kanze

Does main function support unicode?
int main( int argc, char** argv ) can I say int mainw( int argc,
wchar_t** argv )?

With regards to the function signature, no. Beyond that, any
Unicode support (including in wchar_t) is currently
implementation defined. The implementations I use allow Unicode
(UTF-8) in the argv strings, but don't require it. (The real
issue, of course, is where argv comes from. Unix, for example,
allows everything but a '\0' character in each argv argument,
just copying whatever it is given by the program which invoked
your program. Windows is a bit more complicated, but I think it
will work the same regardless of whether you pass UTF-8, 8859-1,
or some other ASCII based encoding---I *think* that it only
treats tab (0x09), space (0x20) and quotes (0x22) specially.)
 

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
474,170
Messages
2,570,927
Members
47,469
Latest member
benny001

Latest Threads

Top