开发者

asp.net mvc and unicode routes and links

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

When i use the actionlink the SomeUnic开发者_JS百科odeHebrewWord 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!


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜