imap_utf8()中转换GBK编码的问题

服务器环境:ubunt feisty,php5.1.2,php5-imap 5.1.2-1ubuntu1

imap_utf8()不能转换GBK编码的汉字,GB2312没有问题
但可以使用iconv_mime_decode($string,0,”UTF-8″)来进行代替

参考: https://bugs.launchpad.net/ubuntu/+source/php5/+bug/137475

BUG重现:
nano test.php

执行:
php5 test.php


已发布

分类

来自

评论

《“imap_utf8()中转换GBK编码的问题”》 有 1 条评论

  1. Murphy Kuo 的头像

    Thanks for this tip and comparison
    I used this tip to fix a bug in receiving mails encoded with GBK but charset=gb2312 in the mail header. The mail receiver will use GB2312 to parse the mail but get garbled in some chinese words which are encoded by GBK which covers Traditional Chinese

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注