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?
Regards, chris
BABEL> (let ((octet-array-utf-16le (make-array 6 :element-type '(unsigned-byte 8) :initial-contents (vector #X66 #X00 #X6F #X00 #X6F #X00)))) (babel:octets-to-string octet-array-utf-16le :encoding :utf-16)) "???" BABEL>
* (select-symtag) --TIME MARK 2010-11-04-- 17:03 0 RDBMS DEBUG About to BEGIN transaction in database #<ORACLE {1003BAE741}> 17:03 0 RDBMS DEBUG Executing "SELECT SYMTAG_KEY FROM symtag" .. 17:03 0 RDBMS DEBUG Preparing command: "SELECT SYMTAG_KEY FROM symtag" 17:03 0 RDBMS DEBUG Fetching "??????????" from buffer at index 0 17:03 0 RDBMS DEBUG Fetched: "???" 17:03 0 RDBMS DEBUG Fetching "??????????" from buffer at index 0 .. #<(AND (VECTOR T 8) (NOT SIMPLE-ARRAY)) {100403E8DF}> * (defparameter foostr (elt (elt * 0) 0))
FOOSTR * (lst (elt foostr 0) (elt foostr 1) (elt foostr 2))
(#\U6600 #\U6F00 #\U6F00) * foostr
"???" *
!DSPAM:4cd2e12548585927441065!
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) #+nil (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)))) 'string))
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 issue")...
David, if you're reading this then update your coding standards... in the long term you'll also benefit from it, believe me... ;)
cl-rdbms-devel@common-lisp.net