"手"
unicode值十六进制: 0x624b
utf-8编码十六进制: 0xe6 0x89 0x8b
unicode二进制: 0110 0010 0100 1011
utf-8二进制: 1110 0110 1000 1001 1000 1011
test.c (文件是utf-8编码)
char *p = "手";
char *p2 = "\u624b";
char buf_p[10];
char buf_p2[10];
strcpy(buf_p, p);
strcpy(buf_p2, p2);
int p_len = strlen(p);
int p2_len = strlen(p2);
=========================================
内存布局
buf_p: {0xe6, 0x89, 0x8b, 0x00}
buf_p2: {0xe6, 0x89, 0x8b, 0x00}
p_len: 3
p_len2: 3
结论: 在gcc中会自动识别\u这个转义字符