PHP Unicode 字符问题 [英] PHP Unicode character questions

查看:23
本文介绍了PHP Unicode 字符问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我找到的一个链接,它甚至有一个我需要在我的其他项目中使用的角色.

Here's a link I found, which even has a character I need to play with for other projects of mine.

http://www.fileformat.info/info/unicode/char/2446/index.htm

该页面上有一个标题为:编码"的框.我想知道一些行.

There is a box with the Title of: "Encodings" on that page. And I am wondering about some of the rows.

我显然需要关于这类事情的课程,但我想知道HTML 实体(十进制)"和HTML 实体(十六进制)"之间有什么区别.

I obviously need a course on this sort of thing, but I'm wondering what the difference is between "HTML Entity (decimal)" and "HTML Entity (hex)".

有趣的是,这让我很困惑,我将这些字符扔到网页上,它们显示得很好.但是我没有在php页面中指定任何UTF-8编码.

The funny thing is, which confuses me, I throw those characters on a web page, and they display fine. But I haven't specified any UTF-8 encoding in the php page.

<?php
$string1 = '&#x2446;';
$string2 = '&#9286;';

echo $string1;
echo '<br>';
echo $string2;
?>

浏览器是否知道如何自动显示两者?更奇怪的是,我只能在 Mac 上的 Firefox 中看到这些字符.但是我的窗口框不想显示它们.我已经在 chrome 和 firefox 中测试过它.我需要告诉浏览器正确查看它们吗?还是操作系统修改?

Does the browser know how to display both automatically? And to make it weirder, I can only see those characters on my Mac, in Firefox. But my windows box doesn't want to show them. I've tested it in chrome, and firefox. Do I need to tell the browsers to view them correctly? Or is it an operating system modification?

推荐答案

您可以在任何编码中使用任何HTML 实体",并且在实践中,如果您安装了合适的字体,则每个浏览器都可以正常工作.好吧,它是为显示当前编码中未包含的字符而创建的.在你的情况下,你必须在你的 Windows 机器上安装一些字体.

You can use any "HTML Entity" in any encoding and in practice, if You have installed appropriate fonts, every browser will work fine. Well, it was created for displaying characters that are not included in current encoding. In Your situations it looks You have to install some fonts on Your Windows box.

另一方面,它几乎与 PHP 无关.

On the other hand, it has almost nothing to do with PHP.

这篇关于PHP Unicode 字符问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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