IMAP URL problems
Rob Siemborski
rjs3 at andrew.cmu.edu
Wed May 5 18:35:13 EDT 2004
On Wed, 5 May 2004, Ewald Dieterich wrote:
> I experience some problems with imapurl_toURL() and imapurl_fromURL()
> from lib/imapurl.c when I use mailbox names with non-ASCII
> characters.
[snip]
> Does anybody know how to fix this?
>
> I think the error is in imapurl_fromURL() because the hex values in
> the IMAP URL ("imap://server/%C3%A4%20%C3%84") look okay if you
> compare them to the hex values of "ä Ä" converted to UTF-8:
This was very helpful. I just committed the following patch to CVS which
fixes it (some variables weren't being properly reset).
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Rob Siemborski * Andrew Systems Group * Cyert Hall 207 * 412-268-7456
Research Systems Programmer * /usr/contributed Gatekeeper
Index: imapurl.c
===================================================================
RCS file: /afs/andrew.cmu.edu/system/cvs/src/cyrus/lib/imapurl.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- imapurl.c 13 Feb 2003 20:15:40 -0000 1.10
+++ imapurl.c 5 May 2004 22:34:18 -0000 1.11
@@ -39,7 +39,7 @@
*
* derived from chris newman's code */
-/* $Id: imapurl.c,v 1.10 2003/02/13 20:15:40 rjs3 Exp $ */
+/* $Id: imapurl.c,v 1.11 2004/05/05 22:34:18 rjs3 Exp $ */
#include <stdio.h>
#include <string.h>
@@ -198,10 +198,11 @@
/* switch out of UTF-7 mode */
if (utf7mode) {
if (bitstogo) {
- *dst++ = base64chars[(bitbuf << (6 - bitstogo)) & 0x3F];
+ *dst++ = base64chars[(bitbuf << (6 - bitstogo)) &
0x3F];
}
*dst++ = '-';
utf7mode = 0;
+ bitstogo = bitbuf = 0;
}
*dst++ = c;
/* encode '&' as '&-' */
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
More information about the Info-cyrus
mailing list