membership turkish character problem in username or password

membership turkish character problem in username or password

Postby sarp » Thu 24 Feb 2011 16:54

Hello,
I have problem to register usernames with turkish characters.
It gives Devart.Data.PostgreSql.PgSqlException of wrong array of bytes for UTF8: 0xf0.

How does membership username and password accept turkish characters?

Used: ASP.NET 4, Devart.Data.PostgreSql, Version=5.10.96.0
sarp
 
Posts: 7
Joined: Thu 24 Feb 2011 16:29
Location: Istanbul, Turkey

HTML ASCII codes and explanations of turkish characters

Postby sarp » Fri 25 Feb 2011 08:21

This is the list of HTML ASCII codes and explanations of turkish characters:
&#199 Latin Capital Letter C Cedilla
&#231 Latin Small Letter C Cedilla
&#220 Latin Capital Letter U Umlaut
&#252 Latin Small Letter U Umlaut
&#214 Latin Capital Letter O Umlaut
&#246 Latin Small Letter O Umlaut
&#304 Latin Capital Letter I Dotted
&#305 Latin Small Letter i Dotless
&#286 Latin Capital Letter G Breve
&#287 Latin Small Letter g Breve
&#350 Latin Capital Letter S Cedilla
&#351 Latin Small Letter s Cedilla

Encoding is used in the project: utf-8

Other encodings used for turkish: windows-1254, ISO-8859-9[/url]
sarp
 
Posts: 7
Joined: Thu 24 Feb 2011 16:29
Location: Istanbul, Turkey

web.config definition

Postby sarp » Fri 25 Feb 2011 13:57

web.config file has following membership definition:

PostgreSql.Web.Providers.PgSqlMembershipProvider" description="dotConnect for PostreSQL membership provider" ...
sarp
 
Posts: 7
Joined: Thu 24 Feb 2011 16:29
Location: Istanbul, Turkey

membership commands in codebehind also do not work.

Postby sarp » Fri 25 Feb 2011 15:44

Membership.CreateUser(userName, password)

command in codebehind also does not work.
Devart.Data.PostgreSql.PgSqlException
sarp
 
Posts: 7
Joined: Thu 24 Feb 2011 16:29
Location: Istanbul, Turkey

encoding doe not solve local character membership problem.

Postby sarp » Fri 25 Feb 2011 16:07

Membership.CreateUser(Encoding.UTF8.GetString(Encoding.Default.GetBytes(userName)), password)

Trying encoding did not solved the problem. This time Membership created the user, but ? was written to database instead of turkish characters in username.

I could not create usernames consisting local characters in DevArt Membership. Does DevArt Membership not accept local characters?
sarp
 
Posts: 7
Joined: Thu 24 Feb 2011 16:29
Location: Istanbul, Turkey

Postby Shalex » Fri 25 Feb 2011 19:38

Try using the "Unicode=true;" connection string parameter. If it doesn't help, please specify the Encoding.CodePage of your application and encoding of your PostgreSQL database. Notify us about the results.
Shalex
Devart Team
 
Posts: 5934
Joined: Thu 14 Aug 2008 12:44

Unicode=true;

Postby sarp » Mon 28 Feb 2011 17:06

Turkish characters problem is solved and Membership creates the user names correctly. Thank you.

Now, there is a problem with characters I & I-dotted. Username with these characters is not found in your Membership functions. Our investigation shows that sql statements' parameters in your Membership conversions are correct. The problem comes from postgresql 9 x64 (with utf8 encoding and windows-1254 collation) database where lower function does not return correct characters.

Sarp Akal
sarp
 
Posts: 7
Joined: Thu 24 Feb 2011 16:29
Location: Istanbul, Turkey

Re: Unicode=true;

Postby Shalex » Tue 01 Mar 2011 17:13

sarp wrote:Now, there is a problem with characters I & I-dotted. Username with these characters is not found in your Membership functions. Our investigation shows that sql statements' parameters in your Membership conversions are correct. The problem comes from postgresql 9 x64 (with utf8 encoding and windows-1254 collation) database where lower function does not return correct characters.

Could you please confirm that the issue you have encountered is caused by PostgreSQL Server itself? If the problem is in our provider, please give us the following:
1) a small test project to reproduce the issue in our environment (use the Membership.CreateUser() and Membership.ValidateUser() methods for simplicity);
2) Encoding.CodePage of your application;
3) the exact version of your PostgreSQL server;
4) the exact version of your current dotConnect for PostgreSQL.
Shalex
Devart Team
 
Posts: 5934
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for PostgreSQL