views:

16

answers:

1

Hi all,

I'm developing a unicode web application (in hebrew). and my route looks like: "SomeUnicodeHebrewWord/{CategoryId}/{CategoryName}/{Page}

When i use the actionlink the SomeUnicodeHebrewWord and CategoryName (also in hebrew) are getting html encoded. how can i avoid that? can't i have the links created with th hebrew characters? it is important for SEO reasons.

Thanks!

A: 

Avoiding HTMLEncoding and URIEncoding is not important for SEO reasons. Maybe there are search engines out there that doesn't understand those encodings, but such half-assed search engines aren't going to impact on your market success. Just worry about professional search engines; all professional search engines (and I'm not just talking about the big ones, all of them) understand how web pages work.

Beyond that, I'd make sure that every object the string is met by understands appropriate encodings (UTF-16 in terms of the first level of .NET processing, UTF-8 in terms of input and output to and from the web). However, it may be a good idea to have links based on the string output URI encoded (the %xx type of encoding, not the &#xXXX; encoding) as some user-agents out there have less issues with such URIs than with IURIs (they're both understood perfectly, and as equivalent by modern search engines) while more modern user-agents will hide the encoding from users, so you get backwards-compatibility without hurting users of modern browsers, or search engines.

Jon Hanna
Hi,Maybe its not important but it looks better as a URL.The thing is that problem is a hebrew word in the route not in a query string parameter, it seems like the engine is doing html encode on anything rendered
TomerMiz
What exactly are you seeing. HTML-encoding doesn't change Hebrew (put <%=Server.HtmlEncode("שָׁלוֹם")%> into a page and you get שָׁלוֹם output into the source) unless necessary because you are using a character encoding in which Hebrew letters are impossible (which is a bad idea). Meanwhile however, Hebrew letters are not allowed in URIs only in IURIs (internationalised URIs). There are still some browsers that can't go IURI -> URI, so putting a URI in the source and letting the browser go -> IURI if sophisticated enough isn't a bad idea.
Jon Hanna