0%

NSTask Output Character

1
2
3
4
5
6
7
8
9
NSTask *task = [[NSTask alloc] init];
NSMutableDictionary * e = [NSMutableDictionary dictionaryWithDictionary:[[NSProcessInfo processInfo] environment]];
[e setObject:@"en_US.UTF-8" forKey:@"LC_ALL"];
[e setObject:@"en_US.UTF-8" forKey:@"LANG"];

// [e setObject:@"zh_CN.UTF-8" forKey:@"LC_ALL"];
// [e setObject:@"zh_CN.UTF-8" forKey:@"LANG"];
//
[task setEnvironment:e];

中文字符编码问题
\xe5\x90\x84\xe7\xa7

添加上面的 environment 就可以了