You must Sign In to post a response.
  • Category: ASP.NET

    How to fetch/take unicode character in querystring?

    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"]);
  • #768838
    Hi,

    You can review in many ways, But the following way will be simpler.



    HttpUtility.UrlEncode(Request.QueryString["name"])



    For RAW querystring, we can use the below query.



    HttpContext.Current.Request.ServerVariables["name"]


    Thanks,
    Mani

  • #768845
    Hi,

    The best way to get your string without effect anything is using Encode&Decode, using this concept while passing time you can encode the string and while retrieve time you can decode as usually.

    Refer below link, this might be helpful to you.

    https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=encode+and+decode+unicode+characters+in+c%23

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/


  • Sign In to post your comments