【原创&交流】Boost库对unicode字符集的支持方式探究解决思路

【原创&交流】Boost库对unicode字符集的支持方式探究链接:Boost库对unicode字符集的支持方式探究最近学习使

【原创&交流】Boost库对unicode字符集的支持方式探究
链接:Boost库对unicode字符集的支持方式探究

最近学习使用Boost库,发现Boost库对unicode字符集的支持好像采用和STL类似的方式(当然没有完全证实)。STL是什么方式呢?就是在原有的ANSI类型上加上w表示这是unicode类型,如 std::string对应std::wstring,std::cout对应std::wcout。Boost库也是采用这种方式,据我已经测试有:
字符串格式化:boost::format对应boost::wformat
文件系统路径:boost::filesystem::path对应boost::filesystem::wpath


  下面是一个测试程序: 

C/C++ code
#include <stdlib.h>#include <iostream>using std::cout;using std::wcout;using std::endl; #include <string>using std::string;using std::wstring;#include "boost/algorithm/string.hpp"#include "boost/filesystem/path.hpp"#include "boost/filesystem/operations.hpp"#include "boost/format.hpp"int main(int argc, char* argv[]){    // ANSI字符的格式化    cout << boost::format( "%1% %2%" ) % "Hell" % "Low" <<endl;     string s1 = boost::str( boost::format( "%2% %1%" ) % "Hell" % "Low" );    cout << s1 << endl;     // UNICODE字符的格式化    wcout << boost::wformat( L"%s %X" ) % L"-1 is" % -1 << endl;     wstring s2 = boost::str( boost::wformat( L"%2$s %1$.2f" ) % 3.141592 % L"Version" );    wcout << s2 << endl;     // 获取应用程序所在目录(ANSI字符),注意是boost::filesystem::path    string AnsiPath = boost::filesystem::initial_path<boost::filesystem::path>().string();    cout<<AnsiPath<<endl;    // 获取应用程序所在目录(UNICODE字符),注意是boost::filesystem::wpath    wstring UnicodePath = boost::filesystem::initial_path<boost::filesystem::wpath>().string();    wcout<<UnicodePath<<endl;    system("PAUSE");    return 0;} 


  编译环境是:WinXp + sp3,VS 2008 + sp1,unicode字符集



[解决办法]
介个。。。
不知道说啥了
[解决办法]
当然,Boost号称准标准库~