Re: imap_utf7_[en|de]code, from/to which charset?
| From: | Moriyoshi Koizumi | Date: | Sun, 12 Jan 2003 18:51:05 +0000 |
| Subject: | Re: imap_utf7_[en|de]code, from/to which charset? | ||
| References: | 1 | Groups: | php.i18n |
| Request: | Send a blank email to php-i18n+get-409@lists.php.net to get a copy of this message | ||
On Sun, Jan 12, 2003 at 06:37:48PM +0100, Jan Schneider wrote:
> The PHP manual is a bit vague on what the imap_utf7 methods
> expect/return: "Converts 8bit data to modified UTF-7 text."
>
> 8bit data in what encoding? iso-8859-1 I guess.
imap_utf7_encode() function appears to regard any input strings as
encoded in iso-8859-1 just like utf8_encode(). And vice versa.
I'll be happy as a developer of php internals if you report such vagueness
at the bug database too.
> Does the modified utf-7 charset exist as such on common systems so that
> I can use mb_convert_encoding() or iconv() instead? If so, what's its name?
As php's iconv extension is a mere wrapper of the iconv library and
imap utf-7 support is lacking in most iconv implementations,
it's generally better to use mb_convert_encoding() than iconv().
Try the following:
mb_convert_encoding("blahblah", "utf7-imap", "iso-8859-15");
Moriyoshi