User-specified encoding for postgresql-socket [Was CCL postgresql-socket with UTF-8]

Kevin Rosenberg <kevin-HJRc7zDS/[email protected]> Sun, 12 Jun 2011 10:00:31 -0600
Newsgroups gmane.lisp.clsql.general
Message-ID <[email protected]>
Otto Diesenbacher wrote:
> so - here is a patch against postgresql-socket-api.lisp to have UTF-8
> support with CCL (tested withh CCL64/Linux and CCL32/Windows) and
> postgresql-socket (against clsql-20110522-git, current quicklisp-dist).

Thanks for the patch, it's a good patch, and I/m releasing CLSQL 4.3.3
with your patch.

There's a better solution that should take someone just a few hours to
implement. Here's what I added to postgresql-socket-api.lisp. Patches
gratefully accepted :)

;; FIXME: The file has code specific to sb-unicode and CCL
;; to assume UTF8 encoded strings.
;; Best fix would be to use the user-specified encoding that is now
;; stored in the database object and use the UFFI 2.x encoding functions
;; to convert strings to/from octet vectors. This allows encoding
;; other than UTF8 and also works on all CL implementations that
;; support wide character strings

Kevin