【问题标题】:2 php functions have different utf-8 output in the same document2个php函数在同一个文档中有不同的utf-8输出
【发布时间】: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


    【解决方案1】:

    检查 utf8 编码功能是否可以帮助http://php.net/manual/en/function.utf8-encode.php

    【讨论】:

    • 我添加了这个但没有改变。
    猜你喜欢
    • 2012-05-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多