[#9503] Double UTF7-IMAP encoding for system folders
Summary Double UTF7-IMAP encoding for system folders
Queue IMP
Queue Version 4.3.9
Type Bug
State Resolved
Priority 1. Low
Owners Horde Developers (at) , jan (at) horde (dot) org, slusarz (at) horde (dot) org
Requester wrobel (at) horde (dot) org
Created 2011-01-11 (2990 days ago)
Updated 2011-01-19 (2982 days ago)
Assigned 2011-01-19 (2982 days ago)
Resolved 2011-01-19 (2982 days ago)
Patch No

2011-01-19 13:14:14 Jan Schneider State ⇒ Resolved
Patch ⇒ No
2011-01-19 13:13:44 CVS Commit Comment #9 Reply to this comment
Changes have been made in CVS for this ticket:

Pass correct charset to NLS::convertCharset() (Bug #9503).
2011-01-19 13:04:17 Gunnar Wrobel Comment #8
Assigned to Michael Slusarz
Reply to this comment

$_prefs['drafts_folder'] = array(
     // The mailbox value must be encoded in the UTF7-IMAP charset (see RFC
     // 3501 [5.1.3]).
     'value' => String::convertCharset(_("Drafts"), NLS::getCharset(), 
     'locked' => false,
     'shared' => false,
     'type' => 'implicit');

works fine as NLS::getCharset().

I admit I don't know if our translation engine always translates to 
NLS::getCharset(). If it does than that sounds like the correct 
2011-01-19 12:20:45 Jan Schneider Comment #7 Reply to this comment
The first charset parameter is not supposed to be empty. Try passing 
NLS::getCharset() instead.
2011-01-19 10:57:02 Gunnar Wrobel Comment #6
State ⇒ Assigned
Reply to this comment
I applied the patch from CVS to imp-4.3.9 but it does not successfully 
solve the problem.

The String "Entwürfe" is now correctly returned from the translation.

The call

String::convertCharset(_("Drafts"), null, 'UTF7-IMAP')

in imp/config/prefs.php however converts that to "Entw&AMMAvA-rfe".

An explicit

String::convertCharset(_("Drafts"), 'UTF8', 'UTF7-IMAP')

results in the correct value "Entw&APw-rfe".

The origin of that problem seems to be that the $from = null setting 
for String::convertCharset leads to mb_convert_encoding() assuming the 
origin charset to be equivalent to mb_internal_encoding(). This is 
"ISO-8859-1" however while the original "Entwürfe" string was provided 
in "UTF8".

Now I wonder if that is a local problem of the Kolab installation or 
whether this needs fixing in the Horde code. Thanks!

2011-01-11 20:30:03 Jan Schneider Comment #5
Taken from Michael Slusarz
State ⇒ Resolved
Reply to this comment
The UTF-7 in the translation was from before we added the 
convertCharset() call to prefs.php. But it looks like I was the only 
translator that took care of using the correct charset in that 
context, that's why the conversion was added.
Anyway, fixed in CVS and Git where it ended up with an automatic merge.
2011-01-11 20:23:21 Git Commit Comment #4 Reply to this comment
Changes have been made in Git for this ticket:

Fix Drafts translation (Bug #9503).

2011-01-11 19:38:40 Gunnar Wrobel Comment #3
Assigned to Jan Schneider
Reply to this comment
Ah, that is of course the other alternative.

Given that our prefs.php.dist in git does suggest to use the UTF7-IMAP 
conversion only in case the folder name contains non-ascii characters 
I assumed the UTF7-IMAP conversion in CVS was unnecessary. In git we 
also have a similar translation in imp/locale/de/LC_MESSAGES/imp.po:

#: lib/IMP.php:473
msgid "Drafts"
msgstr "Entw&APw-rfe"

But looking at the code there it seems as this just relates to the 
display of the folder names.

The correct translation for "Drafts" in German is "Entwürfe" and I 
assume that is all that needs fixing then. Jan, do you agree?

2011-01-11 17:07:31 Michael Slusarz Comment #2
Assigned to Horde DevelopersHorde Developers
State ⇒ Feedback
Reply to this comment
That translation looks incorrect.  The translation should be for the 
word "Drafts".  IMAP encoding is done on the translated word.   
"Drafts" should not be IMAP-encoded in the translation.
2011-01-11 16:53:01 Gunnar Wrobel Assigned to Michael Slusarz
2011-01-11 16:52:37 Gunnar Wrobel Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ Double UTF7-IMAP encoding for system folders
Queue ⇒ IMP
Milestone ⇒
Patch ⇒ Yes
New Attachment: t_imp_H_GW_SystemFolderPrefsDoubleEncoding.diff Download
Reply to this comment
imp-4.3.9 has the following section in config/prefs.php.dist:

$_prefs['drafts_folder'] = array(
     // The mailbox value must be encoded in the UTF7-IMAP charset (see RFC
     // 3501 [5.1.3]).
     'value' => String::convertCharset(_("Drafts"), null, 'UTF7-IMAP'),
     'locked' => false,
     'shared' => false,
     'type' => 'implicit');

At the same time the po/de_DE.po file translates the "Drafts" string 
to "Entw&APw-rfe":

#: config/prefs.php.dist:304
msgid "Drafts"
msgstr "Entw&APw-rfe"

This way imp-4.3.9 creates a draft folder named "Entw&APw-rfe" (UTF-8) 
by default. From the current code in git I assume the encoding in 
prefs.php.dist is unnecessary. Suggested patch attached.

Original report: https://issues.kolab.org/issue4690 [kolab/issue4690 
(Umlaut problems in system folders)]

Saved Queries