php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30546 imap_utf8() incorrectly converts when used in conjunction with setlocale()
Submitted: 2004-10-24 14:04 UTC Modified: 2004-10-24 18:38 UTC
From: ealtin at casdb dot com Assigned:
Status: Not a bug Package: IMAP related
PHP Version: 4.3.9 OS: Debian/unstable
Private report: No CVE-ID: None
 [2004-10-24 14:04 UTC] ealtin at casdb dot com
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_?=");



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-24 18:38 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

This is a bug in the imap library, which is responsible for the conversion.
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Jan 31 18:03:43 2023 UTC