@@ -2769,10 +2769,24 @@ for (size_t i = 0; i < length; i++) ret[i] = OF_BSWAP32(ret[i]); return ret; } + +- (OFData *)dataWithEncoding: (of_string_encoding_t)encoding +{ + void *pool = objc_autoreleasePoolPush(); + OFData *data = + [OFData dataWithItems: [self cStringWithEncoding: encoding] + count: [self cStringLengthWithEncoding: encoding]]; + + [data retain]; + + objc_autoreleasePoolPop(pool); + + return [data autorelease]; +} #ifdef OF_HAVE_UNICODE_TABLES - (OFString *)decomposedStringWithCanonicalMapping { return decomposedString(self, of_unicode_decomposition_table,