librelist archives

« back to archive

getUTF7String in CTCoreFolder is bugged?

getUTF7String in CTCoreFolder is bugged?

From:
Davide Gullo
Date:
2013-07-18 @ 16:41
Hi guys,
maybe I found a bug in CTCoreFolder.

I'm trying it on a Gmail environment in "Slovenčina" (Slovak) language.
When I try to SELECT the "AllMail" folder it returns error: the folder does
not exists.
From the "XLIST" command the "AllMail" folder looks like this:

"[Gmail]/V&AWE-etky spr&AOE-vy"

I try to connect to this folder by this method:

folder = [[[CTCoreFolder alloc] initWithPath:@"[Gmail]/V&AWE-etky
spr&AOE-vy" inAccount:self.params.account] autorelease];

Then happens something very odd.
If I log the IMAP transactions the command sent is:

*>>> 2 SELECT "[Gmail]/V&-AWE-etky spr&-AOE-vy"*
*
*
It is wrong, there are some "-" added.
It is changed by:

myFolder = mailfolder_new(storage, [self getUTF7String:buffer fromString:
myPath], NULL);

I think the method "getUTF7String" creates the problem.
If I log it by NSLog I get "[Gmail]/V&-AWE-etky spr&-AOE-vy"

Have someone any experience?


Thanks and Regards,
Davide


-- 
Davide Gullo, Consulente Web
http://www.m4ss.net
gullo@m4ss.net

Re: getUTF7String in CTCoreFolder is bugged?

From:
Davide Gullo
Date:
2013-07-22 @ 14:08
Hi,
I resolved this issue.

As we know IMAP calls for folder names to always be transmitted/received in
UTF7, so MailCore needs to convert from UTF7 to unicode (NSString) when
receiving a folder name (LIST command), and convert to UTF7 when sending a
folder name.

I fixed a call in my personalized class (CTCoreAccount+Extended.m) on my
fork. It was my bug/issue.
But i found some others bugs even in CTCoreFolder.m: the LIST, COPY, and
MOVE commands.
We fixed it in this commit:
https://github.com/Jazzo/MailCore/commit/d5d04991d319daeb72840c390859a6f77d1e761b

Regards,
Davide





2013/7/18 Davide Gullo <gullo@m4ss.net>

> Hi guys,
> maybe I found a bug in CTCoreFolder.
>
> I'm trying it on a Gmail environment in "Slovenčina" (Slovak) language.
> When I try to SELECT the "AllMail" folder it returns error: the folder
> does not exists.
> From the "XLIST" command the "AllMail" folder looks like this:
>
> "[Gmail]/V&AWE-etky spr&AOE-vy"
>
> I try to connect to this folder by this method:
>
> folder = [[[CTCoreFolder alloc] initWithPath:@"[Gmail]/V&AWE-etky
> spr&AOE-vy" inAccount:self.params.account] autorelease];
>
> Then happens something very odd.
> If I log the IMAP transactions the command sent is:
>
> *>>> 2 SELECT "[Gmail]/V&-AWE-etky spr&-AOE-vy"*
> *
> *
> It is wrong, there are some "-" added.
> It is changed by:
>
> myFolder = mailfolder_new(storage, [self getUTF7String:buffer fromString:
> myPath], NULL);
>
> I think the method "getUTF7String" creates the problem.
> If I log it by NSLog I get "[Gmail]/V&-AWE-etky spr&-AOE-vy"
>
> Have someone any experience?
>
>
> Thanks and Regards,
> Davide
>
>
> --
> Davide Gullo, Consulente Web
> http://www.m4ss.net
> gullo@m4ss.net
>



-- 
Davide Gullo, Consulente Web
http://www.m4ss.net
gullo@m4ss.net