【发布时间】:2015-04-09 20:29:19
【问题描述】:
我有以下 html,其中包含 2 个呈现 PDF 的 php 函数:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<div>
Summary:<?php echo get_post_meta(get_the_ID(), 'summary', true); ?>
</div>
<div class="post-content">
Content:<?php utf8_encode(the_content()); ?>
</div>
</body>
</html>
它们的内容相同,但输出不同。
摘要打印:
总结:我们出去
内容打印:
内容:我们出去吧
这让我相信是调用中的某些东西影响了 utf-8 解码。两个数据库表都使用:CHARSET=utf8
如何让内容部分正确呈现?
【问题讨论】:
标签: php html wordpress encoding utf-8