dreamnb 发表于 2010-9-7 21:02:28

mush sqlite 问题

我用SQLite Expert Personal建立了一个数据库和表xkxrooms.db3选择的UTF8格式

然后用下面的alias测试,可以正常插入数据,并且显示出来。
但是到SQLite Expert Personal查看,插入进来的数据都是乱码。全显示为���˹㳡
而且如果我在Sqlite expert里插入数据,用下面代码显示出来也是乱码,显示为
1=4
2="娴嬭瘯鎴块棿"
3="娴嬭瘯鎴块棿abc"
4="east"

我的Alias如下

require "tprint"
Note("连接数据库")
DatabaseOpen ("db", GetInfo (66) .. "xkxrooms.db3", 6)
--插入数据
DatabaseExec ("db",
[[
INSERT INTO rooms (RoomName, RoomDir) VALUES ('中央广场', 'north|east|west|south');
]])
-- prepare a query
DatabasePrepare ("db", "SELECT * from rooms")
-- execute to get the first row
rc = DatabaseStep ("db")-- read first row
-- now loop, displaying each row, and getting the next one
while rc == 100 do
Note("进入rc循环")
print ("")
values = DatabaseColumnValues ("db")
tprint (values)
rc = DatabaseStep ("db")-- read next row
end -- while loop
-- finished with the statement
DatabaseFinalize ("db")
DatabaseClose ("db")-- close it


请问如何能让mush和sqlite expert都不乱码呢?
页: [1]
查看完整版本: mush sqlite 问题