Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ASp.net application Hindi to unicode convertion problem

Sir i have a .aspx page, there i have text box, which have hindi font. when i put data from keyboard. the text coming in hindi on text box.

but when iam storing it into string variable, not getting actual value.

also i want to convert that record , which in hindi to unicode. then want to store it into database.

someone plzzzzz help, got struck.
Posted

anyone please give me the solutions
 
Share this answer
 
Sanjay

C#.net string type handles unicode, however make sure that you are storing the data in either nvarchar or ntext since varchar and text don't handle unicode data.

The other thing is while displaying the data on a page set text encoding to utf like
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

Regards
Pawan

NOTE: please mark the answer as accepted if it fits your criteria
 
Share this answer
 
Comments
Sanjay_ji 21-Nov-12 4:40am    
thanks Mr. Rai Pawan,
But this is not what exactly i want

here is the code

<asp:TextBox ID="subject" runat="server" Font-Names="Arjun" AutoPostBack="True" ontextchanged="subject_TextChanged">

protected void subject_TextChanged(object sender, EventArgs e)
{
s = subject.Text;

// how do i get record that store exact value in string , that is in Textbox front end, when i type राम from keyboard, it show jke value on screen. please help +91 9580386241
}
Rai Pawan 21-Nov-12 7:20am    
Even then you will have to set the encoding at the time of displaying the string, so get the string in s variable Encoding.UTF8 while displaying.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900