|
@@ -568,11 +568,11 @@ NSMutableDictionary *fileStreams = nil;
|
568
|
568
|
|
569
|
569
|
// Write file chunk into an opened stream
|
570
|
570
|
- (void)writeEncodeChunk:(NSString *) chunk {
|
571
|
|
- NSMutableData * decodedData = [NSData alloc];
|
|
571
|
+ NSData * decodedData = nil;
|
572
|
572
|
if([[self.encoding lowercaseString] isEqualToString:@"base64"]) {
|
573
|
|
- decodedData = [[NSData alloc] initWithBase64EncodedData:chunk options:0];
|
574
|
|
- }
|
575
|
|
- if([[self.encoding lowercaseString] isEqualToString:@"utf8"]) {
|
|
573
|
+ decodedData = [[NSData alloc] initWithBase64EncodedString:chunk options: NSDataBase64DecodingIgnoreUnknownCharacters];
|
|
574
|
+ }
|
|
575
|
+ else if([[self.encoding lowercaseString] isEqualToString:@"utf8"]) {
|
576
|
576
|
decodedData = [chunk dataUsingEncoding:NSUTF8StringEncoding];
|
577
|
577
|
}
|
578
|
578
|
else if([[self.encoding lowercaseString] isEqualToString:@"ascii"]) {
|
|
@@ -793,4 +793,4 @@ NSMutableDictionary *fileStreams = nil;
|
793
|
793
|
return;
|
794
|
794
|
}
|
795
|
795
|
|
796
|
|
-@end
|
|
796
|
+@end
|