Windows API在UNICODE
上看起來很大,您在Visual C++中創建了一個新項目,並且默認將其設置爲UNICODE
。
而我想成爲一名優秀的Windows程序員,我想使用UNICODE
。C++ UNICODE和STL
的問題是C++標準庫和STL(如的std :: string,或的std :: runtime_error)不UNICODE
字符串很好地工作。 我只能傳遞一個的std :: string,或char*
到的std :: runtime_error,我敢肯定的std :: string不支持UNICODE
。
所以我的問題是,我應該如何使用諸如 std :: runtime_error?我應該混合UNICODE
和常規ANSI
? (我認爲這是一個壞主意......)
只需在我的整個項目中使用ANSI
? (不喜歡..)或者什麼?
他們是例外,你是否需要國際化他們,真的需要unicode支持他們? – PlasmaHH 2012-03-08 19:30:03
你可以在整個過程中大多使用'std :: wstring'。 'std :: runtime_error'是一個不幸的例外(不是雙關語!)。 – arx 2012-03-08 19:35:51
[Unicode with what()](http:// stackoverflow。com/questions/3760731/exceptions-with-unicode-what) – 2012-03-08 19:39:20