imbue
来源:互联网 发布:亲宝宝软件下载 编辑:程序博客网 时间:2024/06/08 09:13
#include "stdafx.h"#include <string>#include <iostream>#include <locale>#include <clocale>using namespace std;int main() { std::wstring str = L"ä"; wcout.imbue( std::locale("German") ); //imbue不能使字符正常wcout << str ;std::string str2 = "ä"; cout.imbue( std::locale("German") );cout << str2 ;std::locale::global( std::locale("German") ); //global可以使字符正常输出wcout << str ;cout << str2 ;char* name = setlocale(LC_ALL,NULL); //查询全局locale名字printf("%s",str2); //打印正常//结论:cout,wcout的底层是使用C语言的函数做输出的。C语言的printf等函数依赖于全局locale//因为imbue函数不影响全局locale,所以只imbue不能正常的输出文字system("pause");return 0;}
0 0
- imbue
- imbue(std::locale());
- imbue(std::locale("chs"))
- Android之This element neither has attached source nor attached Javadoc and hence no Javadoc could be
- log4j 操作
- rapidjson的使用
- android studio常用快捷键
- 整理---从手机相册获取图片的方法
- imbue
- 剑指offer之面试题23:从上往下打印二叉树
- vijos p1233
- Spring—— Spring Core
- zoj3946 Highway Project(单源最短路径)
- Xmanager4.0注册码
- 只顾眼前者,才是大赢家 -----摘自罗辑思维
- nodejs base64编码/解码
- 有参数无返回值的函数