Re: [cx-oracle-users] Antw: Bad conversion of a unicode value?
Brought to you by:
atuining
From: Michael S. <ms...@co...> - 2007-11-27 09:49:30
|
matilda matilda schrieb: >>>> Michael Schlenker <ms...@co...> 26.11.2007 18:24 >>> >> I created a Table with sqlplus with some unicode characters in it: >> >> CREATE TABLE nls_testing ( unicp NVARCHAR(10)); >> INSERT INTO nls_testing (nchar(8365)); -- euro symbol uses 2 utf-8 byt= es >> INSERT INTO nls_testing (nchar(9305)); -- some cjk idogram uses 3 utf-= 8 bytes >> COMMIT; >=20 > Hi Michael, >=20 > I just wanted to reproduce your problem, but: > 1) CREATE TABLE nls_testing ( unicp NVARCHAR(10)); > doesn't work. >=20 > 2) a) INSERT INTO nls_testing (nchar(8365)) > b) INSERT INTO nls_testing (nchar(9305)) > are syntactically wrong. >=20 > Decimal 8365 =3D Hex 20AD and NOT 20AC > Decimal 9305 =3D Hex 2459 and NOT 2456 Okay, i try with cut and copy now, had a crappy console..., the values in my python example are still correct, as are the nls settings that i reported. SQL> create table nls_testing (unicp nvarchar2(10)); Tabelle wurde angelegt. SQL> insert into nls_testing values (nchr(8364)); 1 Zeile wurde erstellt. SQL> insert into nls_testing values (nchr(9302)); 1 Zeile wurde erstellt. SQL> select asciistr(unicp), unicp from nls_testing; ASCIISTR(UNICP) UNICP -------------------------------------------------- -------- \20AC =80 \2456 =BF SQL> commit; Transaktion mit COMMIT abgeschlossen. As told, i get the first one correct, but the second does appear to not reach python intact. Michael --=20 Michael Schlenker Software Engineer CONTACT Software GmbH Tel.: +49 (421) 20153-80 Wiener Stra=DFe 1-3 Fax: +49 (421) 20153-41 28359 Bremen http://www.contact.de/ E-Mail: ms...@co... Sitz der Gesellschaft: Bremen | Gesch=E4ftsf=FChrer: Karl Heinz Zachries Eingetragen im Handelsregister des Amtsgerichts Bremen unter HRB 13215 |