QRcodeViewController *qrViewC = [[QRcodeViewController alloc] init];
? ? ? ? ? ? UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:qrViewC];
? ? ? ? ? ? [strongSelfpresentViewController:nav animated:YES completion:nil];
? ? ? ? ? ? qrViewC.resultQR= ^(NSString*info){
? ? ? ? ? ? ? ? [strongSelfdismissViewControllerAnimated:YES completion:^{
? ? ? ? ? ? ? ? ? ? NSString*result;
? ? ? ? ? ? ? ? ? ? NSMutableArray*resultArray = [NSMutableArrayarray];
? ? ? ? ? ? ? ? ? ? BOOLtopChinese = [MultiRolesTopChinese:info];
? ? ? ? ? ? ? ? ? ? if(topChinese){
? ? ? ? ? ? ? ? ? ? ? ? NSArray? *array = [infocomponentsSeparatedByString:@"\r\n"];
? ? ? ? ? ? ? ? ? ? ? ? resultArray = [NSMutableArrayarrayWithArray:array];
? ? ? ? ? ? ? ? ? ? }else{
? ? ? ? ? ? ? ? ? ? ? ? NSArray? *array = [infocomponentsSeparatedByString:@"\r\n"];
? ? ? ? ? ? ? ? ? ? ? ? for(inta=0;a
//? ? ? ? ? ? ? ? ? ? ? ? ? ? NSData *data=[result dataUsingEncoding:NSUTF8StringEncoding];
? ? ? ? ? ? ? ? ? ? ? ? ? ? NSData*data=[array[a]dataUsingEncoding:NSShiftJISStringEncoding];
? ? ? ? ? ? ? ? ? ? ? ? ? ? NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);
? ? ? ? ? ? ? ? ? ? ? ? ? ? NSString*retStr = [[NSStringalloc]initWithData:dataencoding:enc];//如果中?文是utf-8編碼轉(zhuǎn)gbk結(jié)果為空
? ? ? ? ? ? ? ? ? ? ? ? ? ? if([retStrisEqualToString:@""])//如果掃描中?文亂碼則需要處理,否則不處理
? ? ? ? ? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? NSIntegermax = [array[a]length];
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? char*nbytes =malloc(max +1);
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? for(inti =0; i < max; i++)
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? unicharch = [array[a]characterAtIndex: i];
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? nbytes[i] = (char) ch;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? nbytes[max] ='\0';
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? result=[NSStringstringWithCString: nbytesencoding: enc];
? ? ? ? ? ? ? ? ? ? ? ? ? ? }else{
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? result = retStr;
? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? ? ? [resultArrayaddObject:result];
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? }