Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

I modify the CTCoreFolder.m in order to support the chinese path name(UTF8String) #76

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

In order to support the chinese path name for moveMessageWithUID:toPath: and copyMessageWithUID:toPath:.I add the codes into the two methods as follows:

  • (BOOL)copyMessageWithUID:(NSUInteger)uid toPath:(NSString *)path {
    BOOL success = [self connect];
    if (!success) {
    return NO;
    }
    // const char *mbPath = [path cStringUsingEncoding:NSUTF8StringEncoding];
    char mbPath[MAX_PATH_SIZE];
    [self getUTF7String:mbPath fromString:path];//convert UTF8 into UTF7
    int err = mailsession_copy_message([self folderSession], uid, mbPath);
    if (err != MAIL_NO_ERROR) {
    self.lastError = MailCoreCreateErrorFromIMAPCode(err);
    return NO;
    }
    return YES;
    }
  • (BOOL)moveMessageWithUID:(NSUInteger)uid toPath:(NSString *)path {
    BOOL success = [self connect];
    if (!success) {
    return NO;
    }
    // const char *mbPath = [path cStringUsingEncoding:NSUTF8StringEncoding];
    char mbPath[MAX_PATH_SIZE];
    [self getUTF7String:mbPath fromString:path];//convert UTF8 into UTF7
    int err = mailsession_move_message([self folderSession], uid, mbPath);
    if (err != MAIL_NO_ERROR) {
    self.lastError = MailCoreCreateErrorFromIMAPCode(err);
    return NO;
    }
    return YES;
    }
@lichuanjun lichuanjun Create NewCTCoreFolder.m
in order to support the chinese path name for moveMessageWithUID:toPath: and
copyMessageWithUID:toPath:.
6b7b318
Owner

mronge commented Mar 6, 2013

Rather than creating a new file NewCTCoreFolder.m, can you apply these fixes to the existing file CTCoreFolder.m?

Thanks

Hi,I would do that.But I donnot know how to do it,so could you help me apply it,I am sorry.Another question:When I invoke the method :copyMessageWithUID:toPath,the message which be copyed will be deleted from its own folder,just like the result of moveMessage.How did this error happend?Is the uid something wrong?

@mronge mronge closed this Mar 14, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment