diff --git a/PBGitRevList.mm b/PBGitRevList.mm index 8ce2082..61a1b27 100644 --- a/PBGitRevList.mm +++ b/PBGitRevList.mm @@ -76,9 +76,9 @@ using namespace std; BOOL showSign = [rev hasLeftRight]; if (showSign) - arguments = [NSMutableArray arrayWithObjects:@"log", @"-z", @"--early-output", @"--topo-order", @"--pretty=format:%H\01%an\01%s\01%P\01%at\01%m", nil]; + arguments = [NSMutableArray arrayWithObjects:@"log", @"-z", @"--early-output", @"--topo-order", @"--pretty=format:%H\01%e\01%an\01%s\01%P\01%at\01%m", nil]; else - arguments = [NSMutableArray arrayWithObjects:@"log", @"-z", @"--early-output", @"--topo-order", @"--pretty=format:%H\01%an\01%s\01%P\01%at", nil]; + arguments = [NSMutableArray arrayWithObjects:@"log", @"-z", @"--early-output", @"--topo-order", @"--pretty=format:%H\01%e\01%an\01%s\01%P\01%at", nil]; if (!rev) [arguments addObject:@"HEAD"]; @@ -120,6 +120,12 @@ using namespace std; } // From now on, 1.2 seconds + string encoding_str; + getline(stream, encoding_str, '\1'); + NSStringEncoding encoding = NSUTF8StringEncoding; + if (encoding_str.length()) + encoding = CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding((CFStringRef)[NSString stringWithUTF8String:encoding_str.c_str()])); + git_oid oid; git_oid_mkstr(&oid, sha.c_str()); PBGitCommit* newCommit = [[PBGitCommit alloc] initWithRepository:repository andSha:oid]; @@ -152,8 +158,8 @@ using namespace std; stream >> time; - [newCommit setSubject:[NSString stringWithUTF8String:subject.c_str()]]; - [newCommit setAuthor:[NSString stringWithUTF8String:author.c_str()]]; + [newCommit setSubject:[NSString stringWithCString:subject.c_str() encoding:encoding]]; + [newCommit setAuthor:[NSString stringWithCString:author.c_str() encoding:encoding]]; [newCommit setTimestamp:time]; if (showSign)