我想在IE的标题栏(和标签)中添加unicode字符。
我如何使用C#实现这一目标?
I would like to put unicode characters in IE's title bar (and tabs).
How do I achieve this using C#?
最满意答案
Page.Title = "//someunicode//"不起作用
设置Page.Title对我来说很好,假设您正在使用支持Unicode的响应编码,例如默认的UTF-8。
你要设置的角色是什么? 请记住,页面标题是使用操作系统的窗口标题栏字体呈现的,而不是为页面HTML内容设置的字体,因此标题可用的字符范围小于页面内容的字符范围。 如果选择用于标题栏的字体中不存在的字符,则可能会出现正方形。
(对于其他OS渲染的元素也可能出现相同的情况,例如某些浏览器中的选择菜单。)
Page.Title = "//someunicode//" does not work
Setting Page.Title works fine for me, assuming you're using a Unicode-capable response encoding such as the default UTF-8.
What are the characters you are trying to set exactly? Bear in mind that the page title is rendered using the operating system's window title bar font, and not the fonts set up for page HTML content, so you may have a smaller range of characters available for Title than you do for page content. If you choose characters that don't exist in the font used for title bars you may get squares.
(The same may occur for other OS-rendered elements, for example select menus in some browsers.)
更多推荐
发布评论