通过带有特殊字符的clsql-sqlite3记录选择CCL Lisp时出错

时间:2016-02-21 17:10:48

标签: sqlite lisp common-lisp ccl clsql

在Windows10 / 64上,我安装了CCL Lisp 1.11,下载了sqlite3.dll,然后安装了quicklisp和cl-sql。 我在(德语)特殊字符的上下文中出错。 这就是我在Emacs Slime Repl中尝试过的:

(clsql:connect '("C:/users/user/test.sqlite")
               :database-type :sqlite3
               :encoding 'utf-8)
(clsql:execute-command "create table name (name)")
(clsql:execute-command "insert into name values ('Übermaß')")
(format t "~A" (clsql:query "select * from name") )

执行最后一行调用调试器:

Cannot allocate a STRING with NIL elements.
Objects of type STRING can can have at most 
16777215 elements in this implementation.
   [Condition of type CCL::VECTOR-SIZE-LIMITATION] ...
Backtrace
  0: (%STR-FROM-PTR #<A Foreign Pointer #x2D0F8C8> NIL NIL)
  1: ((:INTERNAL CLSQL-SQLITE3::EXTRACT-ROW-DATA (CLSQL-SYS:DATABASE-QUERY (T CLSQL-SQLITE3:SQLITE3-DATABASE T T))))
  2: (#<STANDARD-METHOD CLSQL-SYS:DATABASE-QUERY (T CLSQL-SQLITE3:SQLITE3-DATABASE T T)> "select * from name" #<SQLITE3-DATABASE C:/users/user/test.sqlite OPEN #xCDC1B7E> :AUTO T)
  3: (CCL::%%STANDARD-COMBINED-METHOD-DCODE ((#<STANDARD-METHOD CLSQL-SYS:DATABASE-QUERY :BEFORE (T CLSQL-SYS:DATABASE T T)>) NIL ..) 16705134)
  ... 

我的Emacs .init.el配置为使用UTF-8:

(set-language-environment "utf-8")
(setq inferior-lisp-program "C:/users/user/bin/ccl-1.11/wx86cl.exe -K utf-8")
(setq slime-net-coding-system 'utf-8-unix)
(prefer-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(setq default-buffer-file-coding-system 'utf-8)

如果我尝试在没有UTF-8编码的情况下创建.sqlite数据库文件,插入和选择数据有效,但特殊字符无法正确显示。

0 个答案:

没有答案