(fix) fallback to Latin1 when trying to parse versit data

pull/85/head
Ludovic Marcotte 2015-05-12 10:19:20 -04:00
parent 364a07bd05
commit 64da65d827
1 changed files with 6 additions and 0 deletions

View File

@ -1075,6 +1075,12 @@ static NSCharacterSet *whitespaceCharSet = nil;
// FIXME: Data is not always utf-8.....
source = [[[NSString alloc] initWithData: _data encoding: encoding]
autorelease];
// We fallback to ISO-8859-1 string encoding
if (!source)
source = [[[NSString alloc] initWithData: _data encoding: NSISOLatin1StringEncoding]
autorelease];
if (!source)
{
e = (id)[SaxParseException exceptionWithName: @"SaxIOException"