M3U and PLS playlist handlers now correctly handle macOS Classic line endings
parent
ab6429b62b
commit
ba7aaec69c
|
@ -92,6 +92,16 @@
|
|||
|
||||
filecontents[size] = '\0';
|
||||
}
|
||||
|
||||
// Handle macOS Classic and Windows line endings
|
||||
{
|
||||
char * contentsscan = filecontents;
|
||||
while (*contentsscan) {
|
||||
if (*contentsscan == '\r')
|
||||
*contentsscan = '\n';
|
||||
++contentsscan;
|
||||
}
|
||||
}
|
||||
|
||||
DLog(@"Trying UTF8");
|
||||
NSStringEncoding encoding = NSUTF8StringEncoding;
|
||||
|
|
|
@ -95,6 +95,16 @@
|
|||
filecontents[size] = '\0';
|
||||
}
|
||||
|
||||
// Handle macOS Classic and Windows line endings
|
||||
{
|
||||
char * contentsscan = filecontents;
|
||||
while (*contentsscan) {
|
||||
if (*contentsscan == '\r')
|
||||
*contentsscan = '\n';
|
||||
++contentsscan;
|
||||
}
|
||||
}
|
||||
|
||||
DLog(@"Trying UTF8");
|
||||
NSStringEncoding encoding = NSUTF8StringEncoding;
|
||||
NSString *contents = [NSString stringWithCString:filecontents encoding:encoding];
|
||||
|
|
Loading…
Reference in New Issue