|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-10-24 18:38 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 19:00:01 2025 UTC |
Description: ------------ imap_utf8() incorrectly converts when used in conjunction with setlocale(). I'm working on a Webmail application, which uses gettext for localization and depends on IMAP extension. The output is always UTF-8, so I don't need to mess with charset conversions too much. I'm using imap_utf8() to convert the subject/sender/CC information correctly, directly to UTF8. It works well, unless I'm setting current locale with say, en_US.UTF-8. Then it converts to some 8bit charset even if it's supposed to output UTF-8. Would be easy to reproduce, but you'd need some weird subject line, like this one: Reproduce code: --------------- setlocale(LC_ALL, "en_US.UTF-8"); echo imap_utf8("(IH#: 5176) Re: =?ISO-8859-9?Q?=FCr=FCn=FC_h=FDzl=FD_sat=FDn?==?ISO-8859-9?Q?_al_dedi=F0im_zaman_?="); Expected result: ---------------- setlocale(LC_ALL, "POSIX"); echo imap_utf8("(IH#: 5176) Re: =?ISO-8859-9?Q?=FCr=FCn=FC_h=FDzl=FD_sat=FDn?==?ISO-8859-9?Q?_al_dedi=F0im_zaman_?=");