#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
int main (void)
{
setlocale(LC_ALL, "ja_JP.Shift_JIS");
char Str[3] = {0x82,0xCC,'\0'};
printf ("(%ls)\n", Str); // --> A
wprintf (L"(%ls) \n", Str); // --> B
system ("pause");
}
注:の = (Shift-JIS) 0x82 0xCC
它打印出来很奇怪:(只有三个字符和 \n 被完全忽略了!!)
(()
为什么 A 和 B 都不能打印出用 Shift-JIS 编码的字符?