Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

再提个建议,对字符的判断问题 #42

Open
tucici opened this issue Sep 8, 2018 · 1 comment
Open

再提个建议,对字符的判断问题 #42

tucici opened this issue Sep 8, 2018 · 1 comment

Comments

@tucici
Copy link

tucici commented Sep 8, 2018

1.有时候会误删除//字符,比如我的代码里auto nFind=strUrl.find("//");就会删成这样auto nFind=strUrl.find("
2.对于含有乱码注释的文件,打不开,具体报错方法是:

            NSError *error = nil;
            NSMutableString *fileContent = [NSMutableString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&error];
            
            if (error) {
                printf("打开文件 %s 失败:%s\n", path.UTF8String, error.localizedDescription.UTF8String);
                abort();
                
            }

我的文件乱码注释是://∑˛ŒÒ∆˜∂œø™¡¨Ω”,是否换个编解码试一下,不用NSUTF8StringEncoding?

@klaus01
Copy link
Owner

klaus01 commented Sep 8, 2018

1、注释是有误删除的情况。因我的项目中只有一处误删除,所以我都是删除后手动恢复回来的。
2、我的项目中都是 UTF8 文件,你可以尝试修复后提交代码。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants