asp.net mvc 和 unicode 路由和链接

发布于 2024-09-15 02:37:23 字数 236 浏览 9 评论 0原文

我正在开发一个 unicode Web 应用程序(希伯来语)。 我的路线如下: “SomeUnicodeHebrewWord/{CategoryId}/{CategoryName}/{Page}

当我使用操作链接时,SomeUnicodeHebrewWord 和 CategoryName(也在希伯来语中)正在进行 html 编码。我如何避免这种情况? 我不能使用希伯来语字符创建链接吗?出于 SEO 原因,这很重要。

谢谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

酷到爆炸 2024-09-22 02:37:23

出于 SEO 原因,避免 HTMLEncoding 和 URIEncoding 并不重要。也许有些搜索引擎不理解这些编码,但这种半途而废的搜索引擎不会影响您的市场成功。只需担心专业的搜索引擎即可;所有专业搜索引擎(我不只是谈论大型搜索引擎,所有)都了解网页的工作原理。

除此之外,我会确保字符串所遇到的每个对象都理解适当的编码(UTF-16 就 .NET 处理的第一级而言,UTF-8 就网络的输入和输出而言)。然而,基于字符串输出 URI 编码(%xx 编码类型,而不是 &#xXXX; 编码)建立链接可能是个好主意,因为与使用此类 URI 相比,一些用户代理遇到的问题较少。 IURI(它们都可以被完美理解,并且被现代搜索引擎视为等效),而更现代的用户代理将对用户隐藏编码,因此您可以获得向后兼容性,而不会伤害现代浏览器或搜索引擎的用户。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文