[cl-rdbms-devel] hu, dwim.rdbms + oracle 10g express + utf8 + input/read problem - 2
Marshall McLuhan
marshall.mcluhan at gmx.net
Tue Nov 2 21:39:03 UTC 2010
Hi
Why does hu.dwim.rdbms.oralce not support utf-8 when it comes to connection encodings?
( database encodings supported are utf-8 and us-ascii )
Could that be related to my problem? Doesn't make sense except maybe this was written for cmucl? (a wild guess?)
I can't test this easily because I don't have a 32bit unix installed.
Maybe that's important: I entered the data (symtag_key varchar2, nvarchar2 datatype) into the tables with sqlplus.
But I got the same results (empty spaces/boxes in strings with sbcl started from the shell doing [select "SYMTAG_KEY" from symtag])
entering the data with hu.dwim.rdbms's insert-record function if I did not miss something.
Do you know of a hu.dwim.rdbms.oracle + oracle setup that actually works?
If so what operating system and oracle product is part of this setup?
Sqlplus has no problems showing me the data in both cases:
1. entering the data with sqlplus
2. entering the data with using hu.dwim.rdbms's insert-record
SQL> select "SYMTAG_KEY" from symtag2;
SYMTAG_KEY
----------------------
foo
foobar
SQL> select "SYMTAG_KEY" from symtag;
SYMTAG_KEY
--------------------------------------------------------------------------------
foo
foobar
foo11
If we can't solve this soon I will have to go with ascii or dig into the source code myself.
Have you any hints for the latter?
Regards,
chris
*** 0. no utf-8 connection encoding
** hu.dwim.rdbms/source/oralce/backend.lisp
.. (starts line 97)
(rdbms.debug "Connecting in transaction ~A" transaction)
(oci-call (oci:env-create (environment-handle-pointer transaction)
(logior
(ecase (connection-encoding-of (database-of *transaction*))
(:ascii 0)
(:utf-16 oci:+utf-16+))
*default-oci-flags*)
null null null null 0 null))
..
** hu.dwim.rdbms/source/oracle/database.lisp
.. (starts at line 9)
(def (class* e) oracle (database)
((connection-encoding
:utf-16
:type (member :ascii :utf-16))))
..
*** 1. All my settings are set to utf-8 except for the network encoding of hu.dwim.rdbms
chris at catch22:~$ locale
LANG=de_DE.UTF-8
LC_CTYPE=de_DE.UTF-8
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=
* sb-impl::*default-external-format*
:UTF-8
* (get-encodings)
21:54 0 RDBMS DEBUG About to BEGIN transaction in database #<ORACLE {1004C49001}>
21:54 0 RDBMS DEBUG About to COMMIT transaction #<#<STANDARD-CLASS NIL {1004C970B1}> :begin-executed-p #f {10039EB251}>
(("connection-encoding" . :UTF-16) ("database-encoding" . :UTF-8))
*
*** 2. Fooling around with the NLS_LANG environment variable and sqlplus
AMERICAN_AMERICA.AL32UTF8 doesn't work with sqlplus but AMERICAN_AMERICA.AL32UTF8 does
chris at catch22:~$ sqlplus-connect.sh
Error 19 initializing SQL*Plus
Invalid NLS character set for this OS environment
chris at catch22:~$ $NLS_LANG
bash: AMERICAN_AMERICA.AL16UTF16: Kommando nicht gefunden.
chris at catch22:~$ export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
chris at catch22:~$ sqlplus-connect.sh
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Nov 2 20:24:10 2010
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL>
*** 3. Oracle Environment Variables - bashrc snippet
export ORACLE_HOME=~/usr/instantclient_10_2
export XE=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
export ORACLE_SID=XE
export LD_LIBRARY_PATH=~/lib:/lib:/usr/lib:/usr/local/lib:~/usr/instantclient_10_2:$XE/lib
export PATH=~/bin:~/usr/instantclient_10_2:$XE/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/bin/X11:/usr/games
export ORACLE_USERID='chris/woirgend'
export ORACLE_DSN='dbi:Oracle:XE'
export TNS_ADMIN=~/usr/instantclient_10_2/network/admin
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
*** 4. SBCL console - What kind of characters are we dealing with?
* (select-symtag2)
20:58 0 RDBMS DEBUG About to BEGIN transaction in database #<ORACLE {1004C49001}>
20:58 0 RDBMS DEBUG Executing "SELECT SYMTAG_KEY FROM symtag"
STYLE-WARNING: Undefined alien: "OCIGetInstantClientPackageName"
STYLE-WARNING: Undefined alien: "OCIGetInstantClientPackageName"
20:58 0 RDBMS DEBUG Connecting in transaction #<#<STANDARD-CLASS NIL {1004C970B1}> :begin-executed-p #t {100370D6A1}>
20:58 0 RDBMS DEBUG Logging on in transaction #<#<STANDARD-CLASS NIL {1004C970B1}> :begin-executed-p #t {100370D6A1}>
20:58 0 RDBMS DEBUG Preparing command: "SELECT SYMTAG_KEY FROM symtag"
20:58 0 RDBMS DEBUG Fetching "??????????" from buffer at index 0
20:58 0 RDBMS DEBUG Fetched: "???"
20:58 0 RDBMS DEBUG Fetching "??????????" from buffer at index 0
20:58 0 RDBMS DEBUG Fetched: "??????"
20:58 0 RDBMS DEBUG Fetching "??????????" from buffer at index 0
20:58 0 RDBMS DEBUG Fetched: "?????"
20:58 0 RDBMS DEBUG About to COMMIT transaction #<#<STANDARD-CLASS NIL {1004C970B1}> :begin-executed-p #t {100370D6A1}>
20:58 0 RDBMS DEBUG Cleaning up Oracle transaction #<#<STANDARD-CLASS NIL {1004C970B1}> :begin-executed-p #t {100370D6A1}> to database #<ORACLE {1004C49001}>
20:58 0 RDBMS DEBUG Calling logoff in transaction #<#<STANDARD-CLASS NIL {1004C970B1}> :begin-executed-p #t {100370D6A1}>
20:58 0 RDBMS DEBUG Freeing environment handle of transaction #<#<STANDARD-CLASS NIL {1004C970B1}> :begin-executed-p #t {100370D6A1}>
#<(AND (VECTOR T 8) (NOT SIMPLE-ARRAY)) {100395D23F}>
* (length *)
3
* (setq a **)
; (SETQ SYMARENA-ORACLE::A **)
;
; caught WARNING:
; undefined variable: A
;
; compilation unit finished
; Undefined variable:
; A
; caught 1 WARNING condition
#<(AND (VECTOR T 8) (NOT SIMPLE-ARRAY)) {100395D23F}>
* (elt (elt a 0) 0)
"???"
* (setq b *)
; (SETQ SYMARENA-ORACLE::B *)
;
; caught WARNING:
; undefined variable: B
;
; compilation unit finished
; Undefined variable:
; B
; caught 1 WARNING condition
"???"
* b
"???"
* (elt b 0)
#\U6600
* #\U6600
#\U6600
* (elt b 1)
#\U6F00
*
** 3.1. emacs - scratch buffer - elisp
?U6FFO - doesn't work in the emacs scratch buffer so I copied the char from sbcl to the emacs scratch buffer after expressing it like this in sbcl #\U6FF0
and got the following:
(char-charset ??)
chinese-big5-2
!DSPAM:4cd084f748589401417091!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cl-rdbms-devel/attachments/20101102/51088008/attachment.html>
More information about the cl-rdbms-devel
mailing list