[問題] 讀取不同語系的txt檔

看板C_and_CPP (C/C++)作者 (公爵)時間12年前 (2013/07/04 08:42), 編輯推噓1(1011)
留言12則, 4人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) BCB 6.0 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) 問題(Question): 現在手邊有客戶提供的檔案(俄文的) 因為bcb 6不能支援unicode所以想問問有沒有辦法指定開啟俄文txt檔抓取字串時 自動切換語系 餵入的資料(Input): 俄文的txt檔 預期的正確結果(Expected Output): 能正確讀入俄文字串 錯誤結果(Wrong Output): 字串讀出都亂碼 程式碼(Code):(請善用置底文網頁, 記得排版) 補充說明(Supplement): -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.124.10.146

07/04 10:47, , 1F
multibyte to widechar?轉好之後, 用textoutw測試
07/04 10:47, 1F

07/04 19:20, , 2F
07/04 19:20, 2F

07/04 19:22, , 3F
在Cmd顯示 _wsetlocale(LC_ALL, L"cht"); 改成如下所示…
07/04 19:22, 3F

07/04 19:23, , 4F
俄文 _wsetlocale(LC_ALL, L"rus"); 試試看 (∩_∩)
07/04 19:23, 4F

07/04 20:01, , 5F
不好意思 可以再說明白一點嗎? 哪邊的cmd?
07/04 20:01, 5F


07/05 15:12, , 7F
要顯示在stringgird有辦法嗎?
07/05 15:12, 7F

07/05 16:09, , 8F
自txt讀入一個unicode字串-> W32String-> GetString
07/05 16:09, 8F

07/05 16:11, , 9F
假如 stringgird不支援 unicode就用 W32String::GetString
07/05 16:11, 9F

07/05 20:46, , 10F
BCB6要處理Unicode可以安裝TntUnicodeControls
07/05 20:46, 10F

07/05 20:47, , 11F

07/05 20:48, , 12F
http://tinyurl.com/mye9la3 delphi.ktop相關討論
07/05 20:48, 12F
文章代碼(AID): #1HrCJdsN (C_and_CPP)
文章代碼(AID): #1HrCJdsN (C_and_CPP)