mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-23 19:51:00 +00:00
use initWithBytes:length:encoding: method on NSString to convert the XML data to a string more cleanly, add AUTORELEASE of the string
This commit is contained in:
parent
14e64ef759
commit
eadd4e2ab2
1 changed files with 3 additions and 2 deletions
|
@ -3508,8 +3508,9 @@ static void _real_close(GormDocument *self,
|
|||
[self _buildXLIFFDocumentWithParentNode: group];
|
||||
|
||||
NSData *data = [xliffDocument XMLDataWithOptions: NSXMLNodePrettyPrint | NSXMLNodeCompactEmptyElement ];
|
||||
NSString *xmlString = [NSString stringWithUTF8String: [data bytes]];
|
||||
|
||||
NSString *xmlString = [[NSString alloc] initWithBytes: [data bytes] length: [data length] encoding: NSUTF8StringEncoding];
|
||||
|
||||
AUTORELEASE(xmlString);
|
||||
result = [xmlString writeToFile: name atomically: YES];
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue