By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,320 Members | 2,224 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,320 IT Pros & Developers. It's quick & easy.

Does main function Unicode?

P: n/a
Hi,

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

Thanks
Trupti
Aug 7 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Sa***********@gmail.com wrote:
Does main function support unicode?
int main( int argc, char** argv ) can I say int mainw( int argc,
wchar_t** argv )?
The Standard doesn't have any unicode (or Unicode or UNICODE) support
AFA main function is concerned, but the implementation (the compiler and
the library) are allowed to provide whatever other variations of the
main function they need. The reason it's not in the Standard is that it
would make no sense to require 'mainw' function on the systems that have
no use for Unicode.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Aug 7 '08 #2

P: n/a
On Aug 7, 6:13 pm, "Samant.Tru...@gmail.com" <Samant.Tru...@gmail.com>
wrote:
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.)

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Aug 8 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.