Mailing List Archive

DCoracle2 - truncates UTF-8 string with national characters
Hi!

We're using DCOracle2 with Zope. On the client machine I've
NLS_LANG = polish_poland.UTF8.

The problem appears when I'have 30 characters long column in database,
and the text stored in this column contains national characters and is full
length (30 characters).
When I'm trying to execute select from this column in TOAD, sqlplus etc.
everything is OK (even on client machine), but when I'm executing select
from DCOracle it truncates the results to 30 characters considering one
national characters as two!
So if I have string with 2 national characters, the result from DCOracle2
is in fact 28 characters long, three national characters in string and only
27 characters in result...

Any ideas?? Is it possible to change something in DCOracle source
code to correct this? If so maybe somebody knows where?

--
Maciej Wisniowski
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: DCoracle2 - truncates UTF-8 string with national characters [ In reply to ]
Maciej Wi-B¶niowski wrote at 2005-5-23 14:54 +0200:-A
>We're using DCOracle2 with Zope. On the client machine I've
>NLS_LANG = polish_poland.UTF8.
>
>The problem appears when I'have 30 characters long column in database,
>and the text stored in this column contains national characters and is full
>length (30 characters).

Are you sure that this is a DCOracle2 problem and not a database problem?

UTF-8 may need 5 times more bytes then the character length.

Both DCOracle2 and Oracle may get this wrong.

--
Dieter
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: DCoracle2 - truncates UTF-8 string with national characters [ In reply to ]
Maciej Wiśniowski <maciej.wisniowski@coig.katowice.pl> writes:

> We're using DCOracle2 with Zope. On the client machine I've
> NLS_LANG = polish_poland.UTF8.
>
> The problem appears when I'have 30 characters long column in database,

My ugly hack in dco2.c may be relevant.

http://mail.zope.org/pipermail/zope-db/2004-December/003861.html


Wei-Hao
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: DCoracle2 - truncates UTF-8 string with national characters [ In reply to ]
> Are you sure that this is a DCOracle2 problem and not a database problem?
> UTF-8 may need 5 times more bytes then the character length.
> Both DCOracle2 and Oracle may get this wrong.
Queries from TOAD or sqlplus are returning correct results.
I've tried to run sqlplus query as user Zope on the same
machine where my Zope instance is and i've received correct
results.

> My ugly hack in dco2.c may be relevant.
> http://mail.zope.org/pipermail/zope-db/2004-December/003861.html
I think it may be helpful. We'll try. Thank you.

This is good moment to try SQLRelay too.

--
Maciej Wisniowski

_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db