char to wchar_t conversion
wchar_t c1 = wchar_t('A');
wchar_t c2 = L'A';
Is c1 equal to c2?
If they are not equal, how can I create wchar_t character representing the
same character as some char value?
Re: char to wchar_t conversion
Marcin Kalicinski <firstname.lastname@example.org> wrote:
| wchar_t c1 = wchar_t('A');
| wchar_t c2 = L'A';
| Is c1 equal to c2?
I could not find any guarantee for that in the C++ standard. The only
guarantee i found is that both char(0) and wchar_t(0) shall both have
only zero bits. Apart from that the standard only has limited demands
on the character sets represented by char and wchar_t. Amongst others,
both shall contain the letter A, and rest of the English characters.
| If they are not equal, how can I create wchar_t character representing the
| same character as some char value?
Create a conversion function for the target system. It will probably
port easily if you need it to. Your compiler's documentation should
contain information on how you can write the function.
Since you are asking, you are probably interested in the iconv function,
which is present on UNIX systems. See <URL: http://www.gnu.org/software/libiconv/>,
or search the web.
Robert Bauck Hamar
|All times are GMT. The time now is 10:00 PM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.