UTF8 on server problem

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for Oracle in Delphi and C++Builder
Post Reply
zvasku
Posts: 77
Joined: Tue 19 Sep 2006 12:04

UTF8 on server problem

Post by zvasku » Tue 19 Sep 2006 12:12

Hello,

we have problem with UTF encoded server in both OCI or NET version.
When database is AL16UTF8 then we cann't insert strings using TQuery. Accented cahracter are counted twice so we have got an error message (value is larger than ...) for example:

I have NAME varchar(10) and when I try to insert '123456789ř' than server error shows string size is 11 allowed 10.
Setting of ServerCharset, CharSet and Charlength has no effect.

Do you have any idea about?

Thanks
Zdenek

D2005 UP2, DBEXPODA 3.10.5, ORACLE 10.2.0

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 19 Sep 2006 14:39

In UTF-8 encoding character 'ř' is represented by two bytes. So length of '123456789ř' is 11 bytes. A field of type VARCHAR(10) can contain maximum 10 bytes. Therefore a server raises the error.

If you want to be able to insert any 10 characters into a field then define field type as VARCHAR(10 CHAR).

zvasku
Posts: 77
Joined: Tue 19 Sep 2006 12:04

Post by zvasku » Wed 20 Sep 2006 07:16

Thanks a lot. It works.

Zdenek

Post Reply