@@ -1351,12 +1351,11 @@ cString[length] = '\0'; return length; #endif default: - @throw [OFNotImplementedException exceptionWithSelector: _cmd - object: self]; + @throw [OFInvalidArgumentException exception]; } } - (size_t)getCString: (char *)cString maxLength: (size_t)maxLength @@ -1433,11 +1432,11 @@ @throw e; } break; default: - @throw [OFInvalidEncodingException exception]; + @throw [OFInvalidArgumentException exception]; } @try { ret = [[OFData dataWithItemsNoCopy: cString count: cStringLength + 1 @@ -1504,11 +1503,11 @@ case OFStringEncodingMacRoman: case OFStringEncodingKOI8R: case OFStringEncodingKOI8U: return self.length; default: - @throw [OFInvalidEncodingException exception]; + @throw [OFInvalidArgumentException exception]; } } - (size_t)UTF8StringLength {