[Openmcl-devel] Using clsql (:mysql) to retrieve Unicode strings from a database
paul.meurer at uni.no
Fri Mar 25 13:02:36 CDT 2011
you can issue a
(execute-command "set names UTF8")
after you established your connection. That works for me, although there should be a more elegant solution.
Am 25.03.2011 um 18:23 schrieb Tom Emerson:
> Hi all,
> I'm trying to use the latest CLSQL (with the MySQL backend) to retrieve rows from a database that is using UTF-8 for the VARCHAR columns.
> I had hoped that specifying UTF-8 when opening the connection would be sufficient, e.g.
> (clsql:connect '(nil "database" "user" "password") :database-type :mysql :encoding :utf-8)
> would be sufficient, but any query that includes a UTF-8 column has the database coming back as ?s.
> Has anyone had success doing this? I did try
> (setf UFFI:*DEFAULT-FOREIGN-ENCODING* :utf-8)
> before connecting or making the query, but that didn't help (and shouldn't be necessary regardless.)
> Thanks in advance for any insight you may have.
> P.S. CCL 1.7-dev-r14672M-trunk, 64-bit build. MySQL 5.1.49. I have Python code that can retrieve data from the same database without a problem, so I know it is possible to do. I'd rather stop using Python though.
> Tom Emerson
> tremerson at gmail.com
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Openmcl-devel