hi, i am going crazy, i have tried everything, urlencode, html encode, but urlrewriting.net is reading Arabic querystring as ?? charecters
totally appreciate the help
hi, i am going crazy, i have tried everything, urlencode, html encode, but urlrewriting.net is reading Arabic querystring as ?? charecters
totally appreciate the help
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.
hi, first of all thanks a lot for the answer, i am beginner here and in .Net in general. i don't have the luxury of moving to asp.net routing, but i will in the future.
i put
<system.web>
and here is the hyperlink
hyperlink.NavigateUrl = HttpUtility.UrlDecode("~/News/2008/10/10/تجربة.aspx");
and url rewritting rule is
<add name="NewsArticlePage" virtualUrl="^~/News/([\d]*)/([\d]*)/([\d]*)/(.*).aspx" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/NewsArticlePage.aspx?title=$4" ignoreCase="true"/>
and here is NewsArticle outputting the query code
Response.Write(Request.QueryString["title"]);
the result is ?????
hi, 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
What happens when you run the IIS 7 application in "Classic Mode" (might require installation to be an available option)?
Hello , 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 &"'"