@@ -18,11 +18,11 @@ #include #import "OFString.h" -#import "OFInvalidEncodingException.h" +#import "OFInvalidFormatException.h" #import "autorelease.h" #import "macros.h" int _OFString_XMLUnescaping_reference; @@ -137,12 +137,12 @@ pool = objc_autoreleasePoolPush(); tmp = parse_numeric_entity(entity, entityLength); if (tmp == nil) - @throw [OFInvalidEncodingException - exceptionWithClass: [self class]]; + @throw [OFInvalidFormatException + exception]; [ret appendString: tmp]; objc_autoreleasePoolPop(pool); } else if (delegate != nil) { void *pool; @@ -155,27 +155,25 @@ length: entityLength]; tmp = [delegate string: self containsUnknownEntityNamed: n]; if (tmp == nil) - @throw [OFInvalidEncodingException - exceptionWithClass: [self class]]; + @throw [OFInvalidFormatException + exception]; [ret appendString: tmp]; objc_autoreleasePoolPop(pool); } else - @throw [OFInvalidEncodingException - exceptionWithClass: [self class]]; + @throw [OFInvalidFormatException exception]; last = i + 1; inEntity = false; } } if (inEntity) - @throw [OFInvalidEncodingException - exceptionWithClass: [self class]]; + @throw [OFInvalidFormatException exception]; [ret appendUTF8String: string + last length: i - last]; [ret makeImmutable]; @@ -240,12 +238,12 @@ pool = objc_autoreleasePoolPush(); tmp = parse_numeric_entity(entity, entityLength); if (tmp == nil) - @throw [OFInvalidEncodingException - exceptionWithClass: [self class]]; + @throw [OFInvalidFormatException + exception]; [ret appendString: tmp]; objc_autoreleasePoolPop(pool); } else { void *pool; @@ -257,12 +255,12 @@ stringWithUTF8String: entity length: entityLength]; tmp = block(self, entityString); if (tmp == nil) - @throw [OFInvalidEncodingException - exceptionWithClass: [self class]]; + @throw [OFInvalidFormatException + exception]; [ret appendString: tmp]; objc_autoreleasePoolPop(pool); } @@ -270,12 +268,11 @@ inEntity = false; } } if (inEntity) - @throw [OFInvalidEncodingException - exceptionWithClass: [self class]]; + @throw [OFInvalidFormatException exception]; [ret appendUTF8String: string + last length: i - last]; [ret makeImmutable];