【问题标题】:Apache: Issue to display accented character with Content-type:text/plainApache:使用 Content-type:text/plain 显示重音字符的问题
【发布时间】:2014-05-10 10:09:50
【问题描述】:

我将 Debian 从 Squeeze 升级到 Wheezy。

然后我注意到当 HTTP 标头包含“Content-type: text/plain”时,Apache 不显示正文。 (这不是导航器(浏览器?)问题,因为源显示它是空的,我尝试使用所有导航器。)

当我设置“Content-type: text/html”时,所有正文都正确显示。

我举个例子:

  1. 我在 PHP 中发送带有文本/文本的电子邮件 ⟶ 正文不显示

    $header  = "From:noreply@anydomain.com\n";
    
    $header.= "MIME-version: 1.0\n";
    
    $header .= "Content-type: text/plain; charset=iso-8859-1\n";
    
    mail('email@mysquirrelmailserver', 'subject', 'é' , $header);
    
  2. 我在 PHP 中发送带有 text/html ⟶ 正文的电子邮件

    $header  = "From:noreply@anydomain.com\n";
    
    $header.= "MIME-version: 1.0\n";
    
    $header .= "Content-type: text/html; charset=iso-8859-1\n";
    
    mail('email@mysquirrelmailserver', 'subject', 'é' , $header);
    

Squirrelmail 只是一个例子。 例如,使用 net2ftp 编辑器,所有包含重音字符的文件都无法编辑(正文为空) - 但可以查看并正确显示重音字符。

我还重申,在 Squeeze 版本中一切正常。

谁能帮忙?

【问题讨论】:

    标签: apache debian diacritics


    【解决方案1】:

    我终于明白了

    wheezy 将 php 升级到 5.4

    但在 5.4 php 函数中,htmlentities 的行为与 5.3 不同,这可能是一个需要处理的大问题

    在后面解决 http://blog.wpkg.org/2013/06/20/downgrading-to-php-5-3-on-debian-wheezy-7-0/

    【讨论】:

      猜你喜欢
      • 2011-12-14
      • 2010-11-27
      • 2017-01-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-23
      相关资源
      最近更新 更多