Page 1 of 1
membership turkish character problem in username or password
Posted: Thu 24 Feb 2011 16:54
by sarp
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
HTML ASCII codes and explanations of turkish characters
Posted: Fri 25 Feb 2011 08:21
by sarp
This is the list of HTML ASCII codes and explanations of turkish characters:
Ç Latin Capital Letter C Cedilla
ç Latin Small Letter C Cedilla
Ü Latin Capital Letter U Umlaut
ü Latin Small Letter U Umlaut
Ö Latin Capital Letter O Umlaut
ö Latin Small Letter O Umlaut
İ Latin Capital Letter I Dotted
ı Latin Small Letter i Dotless
Ğ Latin Capital Letter G Breve
ğ Latin Small Letter g Breve
Ş Latin Capital Letter S Cedilla
ş Latin Small Letter s Cedilla
Encoding is used in the project: utf-8
Other encodings used for turkish: windows-1254, ISO-8859-9[/url]
web.config definition
Posted: Fri 25 Feb 2011 13:57
by sarp
web.config file has following membership definition:
<add name="AspNetPgSqlMembershipProvider" type="Devart.Data.PostgreSql.Web.Providers.PgSqlMembershipProvider" description="dotConnect for PostreSQL membership provider" ...
membership commands in codebehind also do not work.
Posted: Fri 25 Feb 2011 15:44
by sarp
Membership.CreateUser(userName, password)
command in codebehind also does not work.
Devart.Data.PostgreSql.PgSqlException
encoding doe not solve local character membership problem.
Posted: Fri 25 Feb 2011 16:07
by sarp
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?
Posted: Fri 25 Feb 2011 19:38
by Shalex
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.
Unicode=true;
Posted: Mon 28 Feb 2011 17:06
by sarp
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
Re: Unicode=true;
Posted: Tue 01 Mar 2011 17:13
by Shalex
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.