0

我有一个简单的批处理,它将特定记录插入到 sql db:

set /P theuserinput="Enter the filename: "
sqlite3 test "insert into films (title, date, start_time) values ('%theuserinput%', '%date%', '%time%');" 

它适用于拉丁文文件名,但是当我尝试将它与西里尔文文件名一起使用时,它会插入一些不可读的字符。

事实证明它工作正常,我只需要在 SQLite Maestro 中查看那些西里尔文记录,而不是在 sqlite3

4

1 回答 1

0

您可以在执行 sqlite 插入到西里尔字母 pgae 之前尝试更改代码页chcp 855

或者到 65001 UTF-8,但是你需要阻止你的命令

set /P theuserinput="Enter the filename: "
(
  chcp 65001
  sqlite3 test "insert into films (title, date, start_time) values ('%theuserinput%', '%date%', '%time%');" 
  chcp 850
)
于 2012-05-11T08:40:56.017 回答