New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parser is failed to parse some files #11
Comments
Please, remove "WEBVTT FILE" and the other blank lines at the top and try again |
Still not working after removing "WEBVTT FILE" and the other blank lines at the top; |
i also had problems with an srt in Spanish, i solved it changing NSUTF8StringEncoding to NSASCIIStringEncoding |
I have also tried it by changing NSUTF8StringEncoding to NSASCIIStringEncoding. Its still not working; Can you please try it by using above Espanish file? There may be chances, something is different in Espanish file format but unable to differentiate it. Thanks |
Hi, I have fixed this issue at my side. Investigated Issue: So, we need to handled both of them. It seems to be working perfectly after syncing both of these flavours. If you wish, i can generate pull request for this changes. For this, i need some permissions over github; Otherwise, you can add following line in MPMoviePlayerController+Subtitles.m after Line#56. subtitleString = [subtitleString stringByReplacingOccurrencesOfString:@"\n\n\n" withString:@"\r\n\r\n"]; Thanks, |
Send me a pull request Thanks! |
Pull Request: #12 |
@shafqat-muneer |
Yes; Merged perfectly. Thanks. |
Please, check merged |
Working perfectly. |
Hi @mhergon ,
I am facing some issue during parsing two files.
https://dl.dropboxusercontent.com/u/32254461/Subtitles/English.srt [Successfully Parsing]
https://dl.dropboxusercontent.com/u/32254461/Subtitles/Espanish.srt [Failed to Parse]
Both files structure is same. You can view it by tapping on links.
Code is breaking on these lines:
NSString *textString;
[scanner scanUpToString:@"\r\n\r\n" intoString:&textString];
textString = [textString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
"textString" is returning whole file data at once in case of some files. These are just sample files; Its also breaking for many English and Espanish files.
Please look into the issue; If i am doing something wrong then please let me know.
Thanks,
Shafqat
The text was updated successfully, but these errors were encountered: