Page 1 of 1

Cannot read correctly a string of bytes from a text field

Posted: Tue 05 Nov 2013 10:00
by radub
In a text field I put a string of ASCII (an custom encrypted string) and I tried to read with a simple PgQuery,
"select 'field' from 'table' where 'keyfield'='key'",
but no matter the type of field I cast it (TBinaryField, TByteField etc), it returns a different string, each time the same length and content.

When executing the query in pgAdmin it return the correct string.

More, if I put a text in that field, even a large one (287k), the query reads correctly, so I think the problem is how the PgDAC is interpreting the content when the field contains control characters.

How can I bypass the issue?

Thank you,
Radu B.

Re: Cannot read correctly a string of bytes from a text field

Posted: Tue 05 Nov 2013 10:43
by AlexP
Hello,

Please send the script for creating and filling in the table or a dump to alexp*devart*com, in order for us to reproduce and fix the problem. Also, please specify the exact versions of the IDE and PgDAC

Re: Cannot read correctly a string of bytes from a text field

Posted: Fri 08 Nov 2013 12:48
by radub
Hello,

In response to the previous post, I've sent a mail to [email protected] on November 5th and I don't know if you have received it or it contains all you needed to reproduce the issue.

Thank you

Radu B.

Re: Cannot read correctly a string of bytes from a text field

Posted: Fri 08 Nov 2013 13:16
by AlexP
Hello,

For correct work with UniCode symbols, you should set the UseUnicode property to True

Re: Cannot read correctly a string of bytes from a text field

Posted: Fri 08 Nov 2013 14:25
by radub
Thnaks! It works.

Re: Cannot read correctly a string of bytes from a text field

Posted: Fri 08 Nov 2013 14:37
by AlexP
Hello,

Glad to see that the problem was solved. If you have any other questions, feel free to contact us.