将boost语言环境与Firebreath一起使用

时间:2013-03-17 03:05:30

标签: firebreath boost-locale

我使用Firebreath创建了一个chrome扩展程序:http://slimtext.org我遇到了一个问题:扩展程序在Windows上不能很好地支持中文字符。经过大量研究后我发现了这一点:http://www.boost.org/doc/libs/1_50_0/libs/locale/doc/html/default_encoding_under_windows.html

我认为解决方案是使用boost / locale。但https://github.com/firebreath/firebreath-boost项目似乎不包含boost / locale。 1.50.0分支包含比主分支更新的提升,但它们都不包含boost / locale。

我尝试使用外部提升,或者从外部提升中复制语言环境代码,但是失败了。(在制作时无法链接到语言环境)

你的建议是什么?如何将boost语言环境与Firebreath一起使用?

2 个答案:

答案 0 :(得分:1)

firebreath-boost只是全面提升的一个子集。要手动使用所有boost安装升压并使用系统升压。见http://www.firebreath.org/display/documentation/Prep+Scripts

答案 1 :(得分:0)

我无法在Windows上使用外部Boost编译我的Firebreath项目。经过大量的调查,我开始怀疑boost / locale是我原来问题的关键:汉字编码问题。

最后我在没有boost / locale的情况下解决了它:

  1. 尽可能使用wstring而不是字符串
  2. 您可能必须单独为Windows和其他操作系统编写代码,例如:
  3. #ifdef _WIN32

        file.open(path.c_str()); //path is std::wstring
    

    #else

        fs::path the_path(path);            
        file.open(the_path.generic_string().c_str());
    

    #endif

相关问题