phpgroupware-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-users] Folders name with UTF-7


From: Sam Przyswa
Subject: Re: [Phpgroupware-users] Folders name with UTF-7
Date: Fri, 02 Aug 2002 17:45:17 +0000

Sam Przyswa (address@hidden) écrivait:
>
>Hi,
>
>We have some problems with folders name in UTF-7 encoding, when we create a 
>folder
>with accentued french characters the folder is well created with accentued
>characters in PHPGW, but this folder is not read by Outlook 2000, read with the
>coded characters instead accentued characters with Outlook Express, and read
>without accentued characters at all with Netscape.
>
>Is it possible to have the same standard folders name encoding in PHPGW and the
>others IMAP mail readers ?

I solved my problem with these changes in email/inc/class.mail_dcom_base.inc.php
v1.6

In function utf7_encode_string($data_str)

replace:
$name['folder_after'] = imap_utf7_encode($name['folder_before']);

with:
$name_tmp = recode_string("ISO-8859-1..UTF-7", $name['folder_before']);
$name['folder_after'] = str_replace("+", "&", $name_tmp);

And in function utf7_decode_string($data_str)

replace:
$name['folder_after'] = imap_utf7_decode($name['folder_before']);

with:
$name_tmp = str_replace("&", "+", $name['folder_before']);
$name['folder_after'] = recode_string("UTF-7..ISO-8859-1", $name_tmp);

That's work in french, for others languages just change "ISO-8859-1" by the 
right
character set, on Unix man recode and recode -l to get the characters set list.

For the recode_string() function you have to compile PHP with --enable-recode 
and
include recode.so in your php.ini

Sam.
--
Sam Przyswa - Chef de projet
Arial Concept - Intégrateur Internet
36, rue de Turin - 75008 - Paris
Tel: 01 40 54 86 04 - Fax: 01 40 54 83 01
Web: http://www.arial-concept.com - Email: address@hidden






reply via email to

[Prev in Thread] Current Thread [Next in Thread]