Unicode字符(六角形)不显示在某些计算机上 [英] Unicode character (hexagon) not displayed on some computers

查看:142
本文介绍了Unicode字符(六角形)不显示在某些计算机上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很大的问题。我刚刚更新了我的网站主页以显示unicode六角形字符:⬢ ⬢ aka U + 2B22

我把它做成200px大,并填充文本。它看起来不错,在我的电脑上运行良好。同时使用Internet Explorer(win8)和Firefox 28.

我在5台不同的计算机上进行了测试,并没有在那里工作!使用Firefox 28和Internet Explorer(win7)测试每台设备和一台计算机,即使使用最新的Chrome浏览器。



那么我做错了什么?它怎么可能在我的FF 28和5个不同的FF 28上运行?

我已经尝试过了:

 <?php header(' Content-Type:text / html; charset = utf-8'); ?> 

直接在HTML中:

  meta http-equiv =content-typecontent =text / html; charset = utf-8

U + 2B22不是utf-8的一部分吗?

在这里尝试一下,滚动到底部: http://jtauber.github.io/articles/css-hexagon.html

对于我的电脑,它看起来像这样: http://250kb.de/u/140401/j/RzN1lYTL8fLJ.jpg

On其他设备看起来像这样: http://250kb.de/u/140401/p/ VEeerGhyv4lM.png



感谢任何帮助!

解决方案

字符U + 2B22 BLACK HEXAGON仅包含在一些字体中。这些字体都没有随Windows或其他广泛使用的软件一起提供,所以在大多数计算机中,没有包含它的字体。此外,即使系统中的某些字体拥有该字符,浏览器也可能无法呈现该字符。有关更多一般性解释,请参阅我的 HTML中使用特殊字符的指南



在这种情况下,字体设置为 font-family:Helvetica Neue,Arial,Helvetica 。这些字体都不包含字符,因此每个浏览器都会尝试使用系统中的其他字体,并且依赖于浏览器的顺序。在你自己的电脑中,你有一个包含字符的字体。您可能已经下载并安装了它,或者它可能带有一些软件。

您可以做的是,或者,

a)在 font-family 声明中指定一个已知包含该字符的字体列表。这可以帮助解决浏览器找不到字体的问题,但这并不重要。b)使用可下载的字体(web字体,通过 @字体面)。如果你只是想要一个字符本质上是非文本的话,这可能会过度。包含U + 2B22的字体一般很大。

c)使用图片,可能作为背景图片。这就是理性的选择,尤其是因为你不会将U + 2B22作为文字中的一个字符,而是作为一种背景。



关于Is U + 2B22不是utf-8的一部分?,字符不是utf-8的一部分。相反,utf-8是一种字符传输编码,所有的Unicode字符(以及所有的Unicode代码点)在utf-8中都有表示。此外,所提及的页面不包含U + 2B22,而是包含字符引用&#x2b22; ,并且这与字符编码无关。因此,这不是一个编码问题,而是一个字体问题。


I have a huge problem. I just updated my websites homepage to display a unicode hexagon character: ⬢ &#x2B22; aka U+2B22
I made it 200px big and filled it with text. It looks good and works fine on my computer. With both Internet Explorer (win8) and Firefox 28.
I tested it on 5 different computers and it didn't work there! Tested with Firefox 28 and Internet Explorer (win7) on each device and on one computer even with the newest Chrome.

So what am I doing wrong? How is it possible that it works on my FF 28 and on 5 different devices with FF 28 it doesn't?

I already tried:

<?php header('Content-Type: text/html; charset=utf-8'); ?>  

and in HTML directly:

meta http-equiv="content-type" content="text/html; charset=utf-8" 

Is U+2B22 not part of utf-8?

Try it yourself here, scroll to the very bottom of: http://jtauber.github.io/articles/css-hexagon.html
For my PC it looks like this: http://250kb.de/u/140401/j/RzN1lYTL8fLJ.jpg
On other devices it looks like this: http://250kb.de/u/140401/p/VEeerGhyv4lM.png

I appreciate any help!

解决方案

The character U+2B22 BLACK HEXAGON is included in a few fonts only. None of those font comes with Windows or with other widely used software, so in most computers, there is no font containing it. Moreover, browsers may fail to render the character even if some font in the system has it. For some more general explanations, see my Guide to using special characters in HTML.

In this case, the font setting is font-family: "Helvetica Neue", Arial, Helvetica. None of those fonts contains the character, so each browser tries to use other fonts in the system, in a browser-dependent order. In your own computer, you have a font that contains the character. You may have downloaded and installed it, or it may have come along with some software

What you could do is, alternatively,

a) specify, in a font-family declaration, a list of fonts known to contain the character. This could help against problems of browsers not finding a font, but this would not matter much.

b) use a downloadable font (web font, via @font-face). This would mostly be overkill if you just want one character for essentially non-text use. Fonts that contain U+2B22 are generally large.

c) use an image instead, possibly as a background image. This would be here the rational choice, especially since you would not use U+2B22 as a character in text but as a background of a kind.

Regarding the question "Is U+2B22 not part of utf-8?", characters aren’t really part of utf-8. Instead, utf-8 is a transfer encoding for characters, and all Unicode characters (and, moreover, all Unicode code points) have representations in utf−8. Besides, the page mentioned does not contain U+2B22 as such but as the character reference &#x2b22;, and this works independently of character encodings. Thus, this is not an encoding problem, but a font issue.

这篇关于Unicode字符(六角形)不显示在某些计算机上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆