2013-03-17 77 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

相關問題