Page 1 of 1

Wrong encoding of PsSqlConnection login credentials

Posted: Wed 06 May 2009 09:26
by kww
Hi,

the encoding of special characters in the UserId and Password property of the PsSqlConnection seems to be wrong:

If i use for example the german special character 'Ä' in these fields, the PgSql connector sends 0x3F to the server, which is ASCII encoding.

It should be 0xC4 in Unicode.

As a result you can't login with special characters in your UserId or Password field.

If I try this with pgAdmin III, everything works fine.

- PgSql Version 3.25.20
- PsSqlConnection.Unicode = true
- PostgreSQL 8.2.4
- Database encoding = UTF8

Thanks for your help

Posted: Wed 06 May 2009 13:45
by Shalex
We will investigate the issue and notify you about the results as soon as possible.

Posted: Fri 08 May 2009 11:08
by Shalex
The problem is fixed. Look forward to the next build of dotConnect for PostgreSQL that will be available in 2 weeks.

Posted: Fri 22 May 2009 16:32
by Shalex
The new build of dotConnect for PostgreSQL 4.50.33 is available for download now.
It can be downloaded from http://www.devart.com/dotconnect/postgr ... nload.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=14911 .

Posted: Thu 29 Apr 2010 08:38
by kww
I tried to verify that this bug is resolved, but it is still there!

I used:

- dotConnect 4.90.124.0 TRIAL
- PostgreSQL 8.2.4
- Database encoding = UTF8

Steps to reproduce the error:

1) Create PostgreSQL role (User "Äaaaa" Password "secret"):

CREATE ROLE "Äaaaa" LOGIN ENCRYPTED PASSWORD 'md54234ca052fc626494c0a3ecf0dbc70f2' NOSUPERUSER NOINHERIT NOCREATEDB NOCREATEROLE;


2) Login from pgAdmin:

-> OK


3) Login from code:

Devart.Data.PostgreSql.PgSqlConnection conn = new Devart.Data.PostgreSql.PgSqlConnection();
conn.Unicode = true;
conn.Host = "192.168.1.1";
conn.Port = 5432;
conn.UserId = "Äaaaa";
conn.Password = "secret";
conn.Database = "postgres";
conn.Open();

-> password authentication failed for user "?aaaa"


The byte sequence for the user name which is sent by your PgSqlConnection is:
0x3f 0x61 0x61 0x61

It should be (like pgAdmin sends it):
0xc3 0x84 0x61 0x61 0x61


The same problem exists, if you use special characters for the password.

So this error still exists?!

Regards,
kww

Posted: Fri 30 Apr 2010 16:08
by StanislavK
We have reproduced the issue. We will investigate it and notify you about the results as soon as possible.

Posted: Fri 09 Jul 2010 17:14
by StanislavK
We've fixed the problem with connecting to PostgreSQL database as a user with Unicode name. The fix is available in the latest 4.95.146 build of dotConnect for PostgreSQL. The build can be downloaded from
http://www.devart.com/dotconnect/postgr ... nload.html
(the trial version) or from Registered Users' Area:
http://secure.devart.com/

For more information on improvements and fixes available in dotConnect for PostgreSQL 4.95.146, please refer to
http://www.devart.com/forums/viewtopic.php?t=18426