J
Josh
Can anyone tell me how do we use Unicode characters in C++ ????
Can anyone tell me how do we use Unicode characters in C++ ????
Ondra said:Josh napsal:
With prefix L:
wchar_t wch = L'ﺙ';
wchar_t* ws = L"ěšÄřžýáÃéǼΨЊتةبאָï¬ï»ïº™ïºµ\x1A6F";
Just remember, that you need to have source file encoded with correct
encoding.
hi Ondra,
thanx but i have few questions.
will this work for each n every platform???
and do i need to include some extra libraries( header files)???
i want to use unicode specifically in linux environment.
can u plz explain in detail???
thanx again
Josh
Josh napsal:
Hi Josh.
As far as I know it should work at least on Windows and on Linux. I can
check it on Linux when I will be home (after about 6 hours).
In C++ is wchar_t built-in type, so you do not need to include any
special header (this is valid only for C++, not for C). So far
standard. However for Visual C++ dot NET it is not true, because you
need to #include <cwchar>. Visual studio 2005 compiler works well from
this point of view, gcc has no problem.
You need to have the source file encoded in some encoding, which is
understandable for your compiler. I tried gcc 3.4.4, and it is capable
to compile UTF8-encoded source on UTF8-based SUSE Linux as well as on
Windows. Visual C compiler seems work too.
Ondra
Josh said:Can anyone tell me how do we use Unicode characters in C++ ????
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.