I have a program in Linux (Ubuntu 13.04) in C.
#include<stdio.h>
int main()
{
char* cp = "ӐҖ";
printf("%s\n",cp);
printf("%d\n",sizeof(*cp));
printf("%d\n",(unsigned int)*cp);
return 0;
}
The first and second printf has ouput of:
ӐҖ
1
respectively.
1.) My first concern is that, in the 3rd printf, I tried to cast the character to unsigned int in an attempt to see that unicode codepoint that represents that first character but I am getting -45. What should be the best approach I should use to see the unicode codepoint of a single unicode character that is represented by a 1 byte "char" data type?
2.) Second concern, when I port this code to Windows 7, [char* cp = "ӐҖ";] will result to a compiler "warning C4566 : character represented by universal-character name '\uFFE6' cannot be represented in the current code page (932)". When I run it,the output are:
??
1
Does Windows don't support unicode in "char" data type? Then what character data type should I use to make my code portable from Linux to Windows?