[Openmcl-devel] Using clsql (:mysql) to retrieve Unicode strings from a database

Tom Emerson tremerson at gmail.com
Fri Mar 25 17:23:39 UTC 2011


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.

    -tree

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
http://treerex.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clozure.com/pipermail/openmcl-devel/attachments/20110325/327294e8/attachment.html>


More information about the Openmcl-devel mailing list