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:@"LANG"];
//
[task setEnvironment:e];

中文字符编码问题
xe5x90x84xe7xa7

添加上面的 environment 就可以了