2013-03-17 78 views
0

我使用Firebreath创建了一个Chrome扩展:http://slimtext.org而且我遇到了一个问题:该扩展在Windows上不支持中文字符。经过大量的研究,我发现:http://www.boost.org/doc/libs/1_50_0/libs/locale/doc/html/default_encoding_under_windows.html与Firebreath一起使用boost locale

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

我试着用外部的刺激,或从外部升压复制的区域设置代码,但没有成功。(不能做链接的时候做对环境)

你有些什么建议?我怎样才能将boost locale和Firebreath一起使用?

回答

0

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

最后我解决它没有升压/区域设置:

  1. 使用wstring的字符串,而不是尽可能
  2. 您可能需要为Windows和其它操作系统,例如单独编写代码:

#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

+0

注意firebreath函数FB :: utf8_to_wstring和FB :: wstring_to_utf8 – taxilian 2013-03-25 04:18:15

1

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

+0

感谢您的答复。我试图编译并安装最新的boost 1.53.0,并按照你发布的说明进行操作。没有任何运气。 firebreath是否与boost 1.53.0兼容? – 2013-03-17 13:50:05

+0

您需要链接boost系统 – taxilian 2013-03-17 16:25:34

+0

您是否有计划将语言环境添加到firebreath-boost项目中?然后我可以像以前一样运行该项目。现在我必须做很多调试和配置。 (我仍然无法在Windows上工作)。我认为语言环境对i18n非常重要。否则firebreath不能支持其他语言以外的其他语言。 – 2013-03-19 08:48:31

相关问题