<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<meta name="Generator" content="Zarafa WebAccess v6.20.4-14107">
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<title>hu, dwim.rdbms + oracle 10g express + utf8 + input/read problem - 2</title>
<style type="text/css">
body
{
font-family: Arial, Verdana, Sans-Serif;
font-size: 12px;
padding: 5px 5px 5px 5px;
margin: 0px;
border-style: none;
background-color: #ffffff;
}
p, ul, li
{
margin-top: 0px;
margin-bottom: 0px;
}
</style>
</head>
<body>
<p>Hi<br /><br />Why does hu.dwim.rdbms.oralce not support utf-8 when it comes to connection encodings?<br />( database encodings supported are utf-8 and us-ascii )<br />Could that be related to my problem? Doesn't make sense except maybe this was written for cmucl? (a wild guess?)<br />I can't test this easily because I don't have a 32bit unix installed.<br /><br />Maybe that's important: I entered the data (symtag_key varchar2, nvarchar2 datatype) into the tables with sqlplus.<br />But I got the same results (empty spaces/boxes in strings with sbcl started from the shell doing [select "SYMTAG_KEY" from symtag])<br />entering the data with hu.dwim.rdbms's insert-record function if I did not miss something.<br /><br />Do you know of a hu.dwim.rdbms.oracle + oracle setup that actually works?<br />If so what operating system and oracle product is part of this setup?<br /><br /><br />Sqlplus has no problems showing me the data in both cases:<br />1. entering the data with sqlplus<br />2. entering the data with using hu.dwim.rdbms's insert-record<br /><br />SQL> select "SYMTAG_KEY" from symtag2;<br /><br />SYMTAG_KEY<br />----------------------<br />foo<br />foobar<br /><br />SQL> select "SYMTAG_KEY" from symtag;<br /><br />SYMTAG_KEY<br />--------------------------------------------------------------------------------<br />foo<br />foobar<br />foo11<br /><br /><br />If we can't solve this soon I will have to go with ascii or dig into the source code myself.<br />Have you any hints for the latter?<br /><br /><br /><br />Regards,<br />chris<br /><br /><br /><br />*** 0. no utf-8 connection encoding<br /><br />** hu.dwim.rdbms/source/oralce/backend.lisp<br />... (starts line 97)<br /> (rdbms.debug "Connecting in transaction ~A" transaction)<br /> (oci-call (oci:env-create (environment-handle-pointer transaction)<br /> (logior<br /> (ecase (connection-encoding-of (database-of *transaction*))<br /> (:ascii 0)<br /> (:utf-16 oci:+utf-16+))<br /> *default-oci-flags*)<br /> null null null null 0 null))<br />...<br /><br /><br />** hu.dwim.rdbms/source/oracle/database.lisp<br />... (starts at line 9)<br />(def (class* e) oracle (database)<br /> ((connection-encoding<br /> :utf-16<br /> :type (member :ascii :utf-16))))<br />...<br /><br /><br /><br />*** 1. All my settings are set to utf-8 except for the network encoding of hu.dwim.rdbms<br /><br />chris@catch22:~$ locale<br />LANG=de_DE.UTF-8<br />LC_CTYPE=de_DE.UTF-8<br />LC_NUMERIC="de_DE.UTF-8"<br />LC_TIME="de_DE.UTF-8"<br />LC_COLLATE="de_DE.UTF-8"<br />LC_MONETARY="de_DE.UTF-8"<br />LC_MESSAGES="de_DE.UTF-8"<br />LC_PAPER="de_DE.UTF-8"<br />LC_NAME="de_DE.UTF-8"<br />LC_ADDRESS="de_DE.UTF-8"<br />LC_TELEPHONE="de_DE.UTF-8"<br />LC_MEASUREMENT="de_DE.UTF-8"<br />LC_IDENTIFICATION="de_DE.UTF-8"<br />LC_ALL=<br /><br /><br />* sb-impl::*default-external-format*<br /><br />:UTF-8<br />* (get-encodings)<br />21:54 0 RDBMS DEBUG About to BEGIN transaction in database #<ORACLE {1004C49001}><br />21:54 0 RDBMS DEBUG About to COMMIT transaction #<#<STANDARD-CLASS NIL {1004C970B1}> :begin-executed-p #f {10039EB251}><br />(("connection-encoding" . :UTF-16) ("database-encoding" . :UTF-8))<br />* <br /><br /><br /><br /><br />*** 2. Fooling around with the NLS_LANG environment variable and sqlplus<br /><br />AMERICAN_AMERICA.AL32UTF8 doesn't work with sqlplus but AMERICAN_AMERICA.AL32UTF8 does<br /><br />chris@catch22:~$ sqlplus-connect.sh <br />Error 19 initializing SQL*Plus<br />Invalid NLS character set for this OS environment<br />chris@catch22:~$ $NLS_LANG<br />bash: AMERICAN_AMERICA.AL16UTF16: Kommando nicht gefunden.<br />chris@catch22:~$ export NLS_LANG=AMERICAN_AMERICA.AL32UTF8<br />chris@catch22:~$ sqlplus-connect.sh <br /><br />SQL*Plus: Release 10.2.0.5.0 - Production on Tue Nov 2 20:24:10 2010<br /><br />Copyright (c) 1982, 2010, Oracle. All Rights Reserved.<br /><br /><br />Connected to:<br />Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production<br /><br />SQL><br /><br /><br /><br /><br />*** 3. Oracle Environment Variables - bashrc snippet<br /><br />export ORACLE_HOME=~/usr/instantclient_10_2<br />export XE=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server<br />export ORACLE_SID=XE<br />export LD_LIBRARY_PATH=~/lib:/lib:/usr/lib:/usr/local/lib:~/usr/instantclient_10_2:$XE/lib<br />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 <br />export ORACLE_USERID='chris/woirgend'<br />export ORACLE_DSN='dbi:Oracle:XE'<br />export TNS_ADMIN=~/usr/instantclient_10_2/network/admin<br />export NLS_LANG=AMERICAN_AMERICA.AL32UTF8<br /><br /><br /><br /><br />*** 4. SBCL console - What kind of characters are we dealing with?<br />* (select-symtag2)<br />20:58 0 RDBMS DEBUG About to BEGIN transaction in database #<ORACLE {1004C49001}><br />20:58 0 RDBMS DEBUG Executing "SELECT SYMTAG_KEY FROM symtag"<br />STYLE-WARNING: Undefined alien: "OCIGetInstantClientPackageName"<br />STYLE-WARNING: Undefined alien: "OCIGetInstantClientPackageName"<br />20:58 0 RDBMS DEBUG Connecting in transaction #<#<STANDARD-CLASS NIL {1004C970B1}> :begin-executed-p #t {100370D6A1}><br />20:58 0 RDBMS DEBUG Logging on in transaction #<#<STANDARD-CLASS NIL {1004C970B1}> :begin-executed-p #t {100370D6A1}><br />20:58 0 RDBMS DEBUG Preparing command: "SELECT SYMTAG_KEY FROM symtag"<br />20:58 0 RDBMS DEBUG Fetching "??????????" from buffer at index 0<br />20:58 0 RDBMS DEBUG Fetched: "???"<br />20:58 0 RDBMS DEBUG Fetching "??????????" from buffer at index 0<br />20:58 0 RDBMS DEBUG Fetched: "??????"<br />20:58 0 RDBMS DEBUG Fetching "??????????" from buffer at index 0<br />20:58 0 RDBMS DEBUG Fetched: "?????"<br />20:58 0 RDBMS DEBUG About to COMMIT transaction #<#<STANDARD-CLASS NIL {1004C970B1}> :begin-executed-p #t {100370D6A1}><br />20:58 0 RDBMS DEBUG Cleaning up Oracle transaction #<#<STANDARD-CLASS NIL {1004C970B1}> :begin-executed-p #t {100370D6A1}> to database #<ORACLE {1004C49001}><br />20:58 0 RDBMS DEBUG Calling logoff in transaction #<#<STANDARD-CLASS NIL {1004C970B1}> :begin-executed-p #t {100370D6A1}><br />20:58 0 RDBMS DEBUG Freeing environment handle of transaction #<#<STANDARD-CLASS NIL {1004C970B1}> :begin-executed-p #t {100370D6A1}><br />#<(AND (VECTOR T 8) (NOT SIMPLE-ARRAY)) {100395D23F}><br />* (length *)<br /><br />3<br />* (setq a **)<br /><br />; (SETQ SYMARENA-ORACLE::A **)<br />; <br />; caught WARNING:<br />; undefined variable: A<br />; <br />; compilation unit finished<br />; Undefined variable:<br />; A<br />; caught 1 WARNING condition<br /><br />#<(AND (VECTOR T 8) (NOT SIMPLE-ARRAY)) {100395D23F}><br />* (elt (elt a 0) 0)<br /><br />"???"<br />* (setq b *)<br /><br />; (SETQ SYMARENA-ORACLE::B *)<br />; <br />; caught WARNING:<br />; undefined variable: B<br />; <br />; compilation unit finished<br />; Undefined variable:<br />; B<br />; caught 1 WARNING condition<br /><br />"???"<br />* b<br /><br />"???"<br />* (elt b 0)<br /><br />#\U6600<br />* #\U6600<br /><br />#\U6600<br />* (elt b 1)<br /><br />#\U6F00<br />*<br /><br />** 3.1. emacs - scratch buffer - elisp<br /><br />?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<br />and got the following:<br /><br />(char-charset ??)<br />chinese-big5-2<br /> </p>
!DSPAM:4cd084f748589401417091!
</body>
</html>