[pg-cvs] CVS pg

emarsden emarsden at common-lisp.net
Fri Jan 27 18:03:39 UTC 2006


Update of /project/pg/cvsroot/pg
In directory common-lisp:/tmp/cvs-serv16285

Modified Files:
	sysdep.lisp 
Log Message:
Fix for encoding support for CLISP and OpenMCL (encoding still not
working correctly).

OpenMCL fix from Risto Laakso.


--- /project/pg/cvsroot/pg/sysdep.lisp	2005/12/19 22:21:50	1.12
+++ /project/pg/cvsroot/pg/sysdep.lisp	2006/01/27 18:03:39	1.13
@@ -1,7 +1,7 @@
 ;;; sysdep.lisp -- system-dependent parts of pg-dot-lisp
 ;;;
 ;;; Author: Eric Marsden <eric.marsden at free.fr>
-;;; Time-stamp: <2005-12-09 emarsden>
+;;; Time-stamp: <2006-01-27 emarsden>
 ;;
 ;;
 
@@ -327,27 +327,25 @@
 (defun implementation-name-for-encoding (encoding)
   (%sysdep "client encoding to external format name"
      #+(and clisp unicode)
-     (cond ((string= encoding "SQL_ASCII") :ascii)
-           ((string= encoding "LATIN1") :latin1)
-           ((string= encoding "LATIN9") :latin9)
-           ((string= encoding "UNICODE") :utf8)
+     (cond ((string= encoding "SQL_ASCII") charset:ascii)
+           ((string= encoding "LATIN1") charset:iso-8859-1)
+           ((string= encoding "LATIN9") charset:iso-8859-9)
+           ((string= encoding "UTF8") charset:utf-8)
            (t (error "unknown encoding ~A" encoding)))
      #+(and allegro ics)
      (cond ((string= encoding "SQL_ASCII") :ascii)
            ((string= encoding "LATIN1") :latin1)
            ((string= encoding "LATIN9") :latin9)
-           ((string= encoding "UNICODE") :utf8)
+           ((string= encoding "UTF8") :utf8)
            (t (error "unknown encoding ~A" encoding)))
      #+(and sbcl sb-unicode)
      (cond ((string= encoding "SQL_ASCII") :ascii)
            ((string= encoding  "LATIN1") :latin1)
            ((string= encoding "LATIN9") :latin9)
-           ((string= encoding "UNICODE") :utf8)
+           ((string= encoding "UTF8") :utf8)
            (t (error "unknown encoding ~A" encoding)))
-     #+(or cmu gcl ecl abcl)
-     (cond ((string= encoding "SQL_ASCII") :ascii)
-           ((string= encoding "LATIN1") :latin1)
-           ((string= encoding "LATIN9") :latin9))))
+     #+(or cmu gcl ecl abcl openmcl)
+     nil))
 
 (defun convert-string-to-bytes (string &optional (encoding *pg-client-encoding*))
   (declare (type string string))
@@ -360,7 +358,7 @@
      #+(and :sbcl :sb-unicode)
      (sb-ext:string-to-octets string
                               :external-format (implementation-name-for-encoding encoding))
-     #+(or cmu gcl ecl abcl)
+     #+(or cmu gcl ecl abcl openmcl)
      (if (member encoding '("SQL_ASCII" "LATIN1" "LATIN9") :test #'string-equal)
          (let ((octets (make-array (length string) :element-type '(unsigned-byte 8))))
            (map-into octets #'char-code string))
@@ -378,7 +376,7 @@
     ;; for implementations that have no support for character
     ;; encoding, we assume that the encoding is an octet-for-octet
     ;; encoding, and convert directly
-    #+(or cmu (and sbcl (not :sb-unicode)) gcl ecl abcl)
+    #+(or cmu (and sbcl (not :sb-unicode)) gcl ecl abcl openmcl)
     (let ((string (make-string (length bytes))))
       (map-into string #'code-char bytes))))
 




More information about the Pg-cvs mailing list