Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -154,11 +154,11 @@ * * If the URL's scheme is file, it tries UTF-8 encoding. * * If the URL's scheme is http(s), it tries to detect the encoding from the HTTP * headers. If it could not detect the encoding using the HTTP headers, it tries - * UTF-8 and falls back to ISO-8859-1 if that fails. + * UTF-8. * * \param URL The URL to the contents for the string * \return A new autoreleased OFString */ + stringWithContentsOfURL: (OFURL*)URL; @@ -291,11 +291,11 @@ * * If the URL's scheme is file, it tries UTF-8 encoding. * * If the URL's scheme is http(s), it tries to detect the encoding from the HTTP * headers. If it could not detect the encoding using the HTTP headers, it tries - * UTF-8 and falls back to ISO-8859-1 if that fails. + * UTF-8. * * \param URL The URL to the contents for the string * \return An initialized OFString */ - initWithContentsOfURL: (OFURL*)URL; Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -749,27 +749,16 @@ encoding = OF_STRING_ENCODING_ISO_8859_15; if ([contentType hasSuffix: @"encoding=windows-1252"]) encoding = OF_STRING_ENCODING_WINDOWS_1252; } - if (encoding == OF_STRING_ENCODING_AUTODETECT) { - @try { - self = [[c alloc] - initWithCString: (char*)[[result data] cArray] - encoding: OF_STRING_ENCODING_UTF_8 - length: [[result data] count]]; - } @catch (OFInvalidEncodingException *e) { - self = [[c alloc] - initWithCString: (char*)[[result data] cArray] - encoding: OF_STRING_ENCODING_ISO_8859_1 - length: [[result data] count]]; - } - } else { - self = [[c alloc] initWithCString: (char*)[[result data] cArray] - encoding: encoding - length: [[result data] count]]; - } + if (encoding == OF_STRING_ENCODING_AUTODETECT) + encoding = OF_STRING_ENCODING_UTF_8; + + self = [[c alloc] initWithCString: (char*)[[result data] cArray] + encoding: encoding + length: [[result data] count]]; [pool release]; return self; }