Click here to Skip to main content
15,890,973 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have created one page and giving url to client.client can enter name in the form of querystring.That name can be unicode character.

like : www.domainname.com/page1.aspx?name=जगती

But when I am catching name in form of querystring getting ????.How to handle this?

string str = Convert.Tostring(Request.QuertString["name"]);


What I have tried:

string str = Convert.Tostring(Request.QuertString["name"]);
Posted
Updated 2-Feb-17 19:21pm

1 solution

First of all, I feel the approach need to reviewed and consider about better approach to get data from client rather than getting it via querystring directly inputted by the client. For example, you get this via a textbox and then encoding the value correctly and send via querystring or other options as per your requirement.

However, if your requirement needs this to be done really with bare querystring manipulation, you can try setting following in the web.config file under system.web tags.
XML
<globalization fileEncoding="iso-8859-1" requestEncoding="iso-8859-1"responseEncoding="iso-8859-1"/>


Reference: How to get Correct QueryString Value from URL having UNICODE value in asp.net? - Stack Overflow[^]

Hope, it helps :)
 
Share this answer
 

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