From 64da65d827a282de96353eeed3179c6e2886a228 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Tue, 12 May 2015 10:19:20 -0400 Subject: [PATCH] (fix) fallback to Latin1 when trying to parse versit data --- SOPE/NGCards/versitCardsSaxDriver/VSSaxDriver.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SOPE/NGCards/versitCardsSaxDriver/VSSaxDriver.m b/SOPE/NGCards/versitCardsSaxDriver/VSSaxDriver.m index b7cc0144c..d9b906c8e 100644 --- a/SOPE/NGCards/versitCardsSaxDriver/VSSaxDriver.m +++ b/SOPE/NGCards/versitCardsSaxDriver/VSSaxDriver.m @@ -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"