#includeusingnamespacestd;voidf1(){wcout.imbue(locale("chs"));wcout());wcout.imbue(loc);wcout根据cplusplus.com的在线文档:codecvt:convertsbetweennativewideandnarrowcharactersets.本程序用VC++编译,Windows运行。在本程序中,内部字符集为UCS-2,由VC++编译器定义;外部字符集,即窄字符集,在控制台环境下是GBK(中文字符集)。如果文档为真,则wcout可以像f1()一样将unicode字符串从UCS-2转换为GBK