[cl-rdbms-devel] hu.dwim.rdbms.oracle-utf-problems-11 - Still trouble even with new babel?

Attila Lendvai attila.lendvai at gmail.com
Thu Nov 4 16:45:23 UTC 2010

> For me it seems iolib is the only system using babel directly?
> Can't see iolib using the octects-to-string function, only for dns but maybe
> I didn't look hard enough.
> Or it uses another babel function to do this?
> Do I have to turn on the right byte-ordering somewhere, just for the time
> being?

ouch: this is in oracle/cffi-util.lisp

(def function oci-string-to-lisp (pointer &optional size)
  (cffi:foreign-string-to-lisp pointer :count size
                               :encoding (connection-encoding-of
(database-of *transaction*)))
  ;; the above doesn't work, because babel thinks the encoding is
  ;; invalid and returns question marks only.  Perhaps Babel doesn't
  ;; understand the endianness?  Need to investigate.
  (coerce (iter (for i from 0 by 2)
		(when size (while (< i size)))
		(let ((code (cffi:mem-ref pointer :short i)))
		  (until (zerop code))
		  (collect (code-char code))))

try to re-enable the #+nil-ed line and drop the rest...

this change is nasty, it should have deserved a KLUDGE comment, or
maybe even better would have been a runtime (warn "description of the

David, if you're reading this then update your coding standards... in
the long term you'll also benefit from it, believe me... ;)


More information about the cl-rdbms-devel mailing list