Re: [-AI-] SQLite 與 utf-8 中文的問題

看板EzHotKey作者時間16年前 (2009/01/24 21:52), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
剛剛感謝 ward 版友的幫忙找到答案了 _SQLite_FetchData 要加第三個參數設成 binary mode 才可以 所以 code 改成下面這樣就可以正常讀取中文了 #include <SQLite.au3> #include <SQLite.dll.au3> Local $hQuery, $aRow, $path $path = @ScriptDir & "\tmp.sqlite" _SQLite_Startup () _SQLite_Open ($path) _SQLite_Exec (-1, "PRAGMA encoding = 'UTF-8';") _SQlite_Query (-1, "SELECT * FROM data;", $hQuery) While _SQLite_FetchData ($hQuery, $aRow, 1) = $SQLITE_OK $aRow[1] = BinaryToString($aRow[1], 4) ConsoleWrite($aRow[0] & " | " & $aRow[1] & @CRLF) WEnd _SQLite_Close() _SQLite_Shutdown() -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.115.182.164
文章代碼(AID): #19UnqG1s (EzHotKey)
文章代碼(AID): #19UnqG1s (EzHotKey)