Josh napsal:
Ondra Holub wrote:
Josh napsal:
Can anyone tell me how do we use Unicode characters in C++ ????
With prefix L:
wchar_t wch = L'ﺙ';
wchar_t* ws = L"ěščřžýá*éǼΨЊتةبאָ*ﻏﺙﺵ\x1 A6F";
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
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