GVKun编程网logo

PHP iconv(): Unknown error (84)

19

在这里,我们将给大家分享关于PHPiconv():Unknownerror(84)的知识,同时也会涉及到如何更有效地Anunknownerroroccurred.、Android4.0ICSWebvi

在这里,我们将给大家分享关于PHP iconv(): Unknown error (84)的知识,同时也会涉及到如何更有效地An unknown error occurred.、Android 4.0 ICS Webview with “Unknown chromium error: -6”、AVFoundationErrorDomain Code=-11800, An unknown error occurred (-12780)、Couldn''t register com.X.XX with the bootstrap server. Error: unknown error code. 错误的内容。

本文目录一览:

PHP iconv(): Unknown error (84)

PHP iconv(): Unknown error (84)

今天要导出四月份的数据,但是在导出的时候出现了一个问题,在导出数据的最后出现了一堆代码,而且数据导出不完整

然后在本地服务器测试的时候发现却是可以正常导出的

比较发现自己把本地的警告提示等级调成了(E_ALL& ~E_NOTICE & ~E_STRICT)

而在服务器上的是(E_ALL)

之后调取 php notice,发现错误是 iconv (): Unknown error (84)

很迷茫不知道是什么错误,百度一下

string iconv ( string $in_charset , string $out_charset , string $str )
将字符串 str 从 in_charset 转换编码到 out_charset。

参数
in_charset:输入的字符集。
out_charset:输出的字符集。

查看官方文档

The output charset.
If you append the string //TRANSLIT to out_charset transliteration is activated. This means that when a character can’t be represented in the target charset, it can be approximated through one or several similarly looking characters. If you append the string //IGNORE, characters that cannot be represented in the target charset are silently discarded. Otherwise, str is cut from the first illegal character and an E_NOTICE is generated.

大概的意思就是:
如果你加上 //TRANSLIT 到 out_charset 的参数后面,意味着如果找不到目标编码,则程序会去找与其相近的编码。如果你加的是 //IGNORE,则不会去找相近的编码,而且只要有一个字符是程序无法识别的则将会报错。

即可确定问题方向了

iconv () 函数转码的时候某个字符不能被目标字符所表示

这时候就需要 iconv () 函数第二个参数的 //TRANSLIT、//IGNORE 两个值了

于是我将代码:

$row[$key] = iconv(''utf-8'', ''gbk'', $value);

改为:

PHP

$row[$key] = iconv(''utf-8'', ''gbk//TRANSLIT//IGNORE'', $value);

 

An unknown error occurred.

An unknown error occurred.

当我们利用 xcode 连接真机进行开发的时候,编译运行到真机上的时候,编译成功,在 copy file to device 的途中突然遇到 An unknown error occurred. 这样的错误。

发好的包安装不上机器等。

如果仅仅提示 “An unknown error occurred.” 而没有其他任何废话(Se* th* instal* lo* fo* mor* detai*s.)的话。那么极有可能的情况就是你的机器内存满了,没有剩余空间来安装接下来这个应用。


Android 4.0 ICS Webview with “Unknown chromium error: -6”

Android 4.0 ICS Webview with “Unknown chromium error: -6”

android 的 webview 加载 html

老是报错:

10-11 08:52:31.449: ERROR/Web Console(2050): Uncaught SyntaxError: Unexpected string at null:1


android 版本有 2.2 换成 4.0 后,多了许多错误
10-11 08:52:33.599: DEBUG/chromium(2050): Unknown chromium error: -6

页面能够加载完整!!!

AVFoundationErrorDomain Code=-11800, An unknown error occurred (-12780)

AVFoundationErrorDomain Code=-11800, An unknown error occurred (-12780)

## 期望:

PHAsset 保存到沙盒指定目录

## 实现方法:

- (PHImageRequestID)requestExportSessionForVideo:(PHAsset *)asset options:(nullable PHVideoRequestOptions *)options exportPreset:(NSString *)exportPreset resultHandler:(void (^)(AVAssetExportSession *__nullable exportSession, NSDictionary *__nullable info))resultHandler;

## 结果:

Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (-12780), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x28208c600 {Error Domain=NSOSStatusErrorDomain Code=-12780 "(null)"}}

## 原因:   优先检查路径,AVAssetExportSession 的属性 outputURL 为 [NSURL fileURLWithPath:path], 而不是 [NSURL URLWithString:path].

## 完整代码如下:

//PHAsset 的扩展方法
- (void)saveVideoDataWithFileName:(NSString *)fileName finish:(void(^)(BOOL saveOk))completion {
    //确定保存路径
    NSString *directory = GVUSER.isLockedAlbum? DIRECTORY_VIDEO_LOCK : DIRECTORY_VIDEO;
    NSString *path = [directory stringByAppendingPathComponent:fileName];
    BOOL fileExist = [FILEMANAGER fileExistsAtPath:path];
    if (!fileExist) {
        PHVideoRequestOptions *option = [[PHVideoRequestOptions alloc] init];
        option.version = PHVideoRequestOptionsVersionOriginal;
        option.deliveryMode = PHVideoRequestOptionsDeliveryModeHighQualityFormat;
        option.networkAccessAllowed = YES;
        [PHImageManager.defaultManager requestExportSessionForVideo:self options:option exportPreset:AVAssetExportPresetHighestQuality resultHandler:^(AVAssetExportSession * _Nullable exportSession, NSDictionary * _Nullable info) {
            exportSession.outputFileType = AVFileTypeMPEG4;
            exportSession.outputURL = [NSURL fileURLWithPath:path];
            [exportSession exportAsynchronouslyWithCompletionHandler:^{
                // 如果导出的状态为完成
                if ([exportSession status] == AVAssetExportSessionStatusCompleted) {
                    //保存完成
                    completion(YES);
                }else if (exportSession.status == AVAssetExportSessionStatusFailed){
                    NSLog(@"错误0----%@",exportSession.error);
                    completion(NO);
                }
            }];
        }];
    }else {
        NSString *newFileName = fileName.fixedFileName;
        [self saveVideoDataWithFileName:newFileName finish:^(BOOL saveOk) {
            completion(saveOk);
        }];
    }
}

//NSString 的扩展方法
- (NSString *)fixedFileName {
    NSString *newFileName;
    NSArray *coms = [self componentsSeparatedByString:@"."];
    //有格式显示
    if (coms.count > 1) {
        NSString *fileFormat = coms.lastObject;
        //        NSString *pureName = coms[coms.count-2];
        NSString *dotFormat = [@"." stringByAppendingString:fileFormat];
        NSString *pureName = [self stringByReplacingOccurrencesOfString:dotFormat withString:@""];
        NSString *newPureName;
        if ([pureName hasSuffix:@")"]) {
            //有(*)
            if (pureName.length > 1) {
                NSString *num = [pureName substringWithRange:NSMakeRange(pureName.length-2, 1)];
                NSString *newNum = [NSString stringWithFormat:@"%ld", (long)(num.integerValue+1)];
                newPureName = [pureName stringByReplacingOccurrencesOfString:num withString:newNum];
            }else {
                newPureName = [pureName stringByAppendingString:@"1"];
            }
            newFileName = [NSString stringWithFormat:@"%@.%@", newPureName, fileFormat];
        }else {
            newFileName = [NSString stringWithFormat:@"%@(1).%@", pureName, fileFormat];
        }
    }

    //没有格式显示
    else {
        newFileName = [self stringByAppendingString:@"(1)"];
    }
    return newFileName;
}

Couldn''t register com.X.XX with the bootstrap server. Error: unknown error code. 错误

Couldn''t register com.X.XX with the bootstrap server. Error: unknown error code. 错误

错误:Couldn''t register com.XX.XXX with the bootstrap server. Error: unknown error code.

This generally means that another instance of this process was already running or is hung in the debugger.

解决:此时stop掉另一个project

然后重启xCode

 

 

 

今天的关于PHP iconv(): Unknown error (84)的分享已经结束,谢谢您的关注,如果想了解更多关于An unknown error occurred.、Android 4.0 ICS Webview with “Unknown chromium error: -6”、AVFoundationErrorDomain Code=-11800, An unknown error occurred (-12780)、Couldn''t register com.X.XX with the bootstrap server. Error: unknown error code. 错误的相关知识,请在本站进行查询。

本文标签: