views:

125

answers:

1

I am sending an arabic value in a querystring, when retrieving it on the server, the value is erroneous and is replaced by quotation marks (????). for example: http://server/mypage.aspx?qs=مرحبا the value of Request.QueryString("qs") is ?????

Note that Response.Write('مرحبا') executes correctly.

Any idea about this querystring problem?

Thanks.

+1  A: 

Just URL Encode the arabic string and it should work fine.

Edit: You must URL Encode the string before putting it in the querystring.

For instance, if you were to url encode the space character, it will appear as %20 in your querystring, like this:

http://foo.com/dosomething?param1=hello%20world

Then when you read param1 you URL Decode it, and you get the string "hello world"

You could also URL Encode every single character but for regular characters it's pointless.

Matteo Mosca
I am typing the querystring directly in the browser. when the page loads it transfers the QS to the Silverlight object via parameters, something like this:<param name="initParams" value="QS=<%=Request.QueryString["QS"]%>"/>when the silverlight object receives the param (e.initparams["qs"]) it's already ????.Where exactly should i encode the string?
Zee99