Question

i am going crazy, i have tried everything, urlencode, html encode, but urlrewriting.net is reading Arabic querystring as ?? charecters

totally appreciate the help

Was it helpful?

Solution 3

After long tedious trials My advise to anyone who is using URL Rewriting with IIS 7 in integrated mode, stop wasting your time and either use MVC routing or forget about Arabic Strings in URL

OTHER TIPS

If you have .NET 3.5 SP1 installed, I'd recommend you to switch to System.Web.Routing instead of the UrlRewriting.net library. I've recently switched from UrlRewriting.net to System.Web.Routing myself and routing is so much better thought out and better integrated with the ASP.NET pipeline.

If you have the opportunity to switch, I'd recommend it. If not, please post your UrlRewriting.net configuration file so we can tweak the regular expressions that apparently aren't working. Please post some examples of URIs that don't work too.

Also, what's the values defined in the web.config section:

<system.web>
  <globalization requestEncoding="utf-8"
                 responseEncoding="utf-8"
                 fileEncoding="utf-8" />
</system.web>

Like in the above example, use UTF-8. Also be sure to encode the characters as UTF-8 in the URI.

What happens when you run the IIS 7 application in "Classic Mode" (might require installation to be an available option)?

Try this , it is faster .. and problems free .

"~/News/2008/10/10/newsid/تجربة.aspx" where newsid is the ID of your article .

Get your title from the database : 'select * from news where id = ' & newsid It is much faster than : "select * from news where title='"& title &"'"

it seems that i have solved the problem by making sure that both pages, the one that contains the link and the one to parse the query string have UTF-8 Encoding

but now i got another problem Firefox is displaying the hyper link and the link in address bar correctly but in IE6 and Ie 7 it is like this

mysite/News/2008/10/10/%D8%AA%D8%AC%D8%B1%D8%A8%D8%A9.aspx

even though IE 6 and 7 are parsing the link fine, but this is ugly, what is the solution please ?

Update: man you wont believe it, i have found the problem it is so strange, it is with IIS 7 Integrated Mode, try to launch your page from visual studio Dev server and Unicode characters will be parsed just fine, but if you launch the page from IIS 7 it will give you the ???? characters.

hope some body will shade some light here

you can use -> Server.UrlEncode(productName) in global.aspx or before rewriting then use Server.UrlDecode(Request.QueryString["productName"]); in PageLoad

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top