mronge/MailCore — pull request #76 by lichuanjun (2013-02-27 03:31:34+00:00)
Title: I modify the CTCoreFolder.m in order to support the chinese path name(UTF8String)

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;
}