Index: src/OFDNSResolverSettings.m ================================================================== --- src/OFDNSResolverSettings.m +++ src/OFDNSResolverSettings.m @@ -266,11 +266,13 @@ return; } staticHosts = [OFMutableDictionary dictionary]; - while ((line = [file readLine]) != nil) { + /* Use ISO 8859-1 to ignore any potential non-UTF-8 comments. */ + while ((line = + [file readLineWithEncoding: OFStringEncodingISO8859_1]) != nil) { OFArray *components, *hosts; size_t pos; OFString *address; pos = [line rangeOfString: @"#"].location; @@ -366,11 +368,13 @@ } if (nameServers == nil) nameServers = [OFMutableArray array]; - while ((line = [file readLine]) != nil) { + /* Use ISO 8859-1 to ignore any potential non-UTF-8 comments. */ + while ((line = + [file readLineWithEncoding: OFStringEncodingISO8859_1]) != nil) { void *pool2 = objc_autoreleasePoolPush(); size_t pos; OFArray *components, *arguments; OFString *option;