解决方法就是转码
关键代码:
id<NSFastEnumeration> results =
[info objectForKey:ZBarReaderControllerResults];
ZBarSymbol *symbol =nil;
for(symbolin results) {
// EXAMPLE: just grab the first barcode
break;
}
//symbol.data;
//处理部分中文乱码问题
if ([symbol.datacanBeConvertedToEncoding:NSShiftJISStringEncoding])
{
symbol.data = [NSStringstringWithCString:[symbol.datacStringUsingEncoding: NSShiftJISStringEncoding]encoding:NSUTF8StringEncoding];
}