Revision: 3683 http://skim-app.svn.sourceforge.net/skim-app/?rev=3683&view=rev Author: hofman Date: 2008-04-08 16:46:04 -0700 (Tue, 08 Apr 2008)
Log Message: ----------- Use lossy conversion to ISO latin 1 for contents values in FDF export. Modified Paths: -------------- trunk/NSString_SKExtensions.h trunk/NSString_SKExtensions.m trunk/PDFAnnotation_SKExtensions.m trunk/SKDocument.m Modified: trunk/NSString_SKExtensions.h =================================================================== --- trunk/NSString_SKExtensions.h 2008-04-08 22:53:34 UTC (rev 3682) +++ trunk/NSString_SKExtensions.h 2008-04-08 23:46:04 UTC (rev 3683) @@ -54,6 +54,7 @@ - (NSComparisonResult)localizedCaseInsensitiveNumericCompare:(NSString *)aStr; - (NSString *)lossyASCIIString; +- (NSString *)lossyISOLatin1String; - (NSString *)stringByEscapingParenthesis; Modified: trunk/NSString_SKExtensions.m =================================================================== --- trunk/NSString_SKExtensions.m 2008-04-08 22:53:34 UTC (rev 3682) +++ trunk/NSString_SKExtensions.m 2008-04-08 23:46:04 UTC (rev 3683) @@ -235,6 +235,10 @@ return [[[NSString alloc] initWithData:[self dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES] encoding:NSASCIIStringEncoding] autorelease]; } +- (NSString *)lossyISOLatin1String { + return [[[NSString alloc] initWithData:[self dataUsingEncoding:NSISOLatin1StringEncoding allowLossyConversion:YES] encoding:NSASCIIStringEncoding] autorelease]; +} + - (NSString *)stringByEscapingParenthesis { static NSCharacterSet *parenAndBackslashCharSet = nil; Modified: trunk/PDFAnnotation_SKExtensions.m =================================================================== --- trunk/PDFAnnotation_SKExtensions.m 2008-04-08 22:53:34 UTC (rev 3682) +++ trunk/PDFAnnotation_SKExtensions.m 2008-04-08 23:46:04 UTC (rev 3683) @@ -217,7 +217,7 @@ } else { [fdfString appendFormat:@"/%s<</%s 0.0>>", SKFDFAnnotationBorderStylesKey, SKFDFAnnotationLineWidthKey]; } - [fdfString appendFormat:@"/%s(%@)", SKFDFAnnotationContentsKey, (contents ? [contents stringByEscapingParenthesis] : @"")]; + [fdfString appendFormat:@"/%s(%@)", SKFDFAnnotationContentsKey, (contents ? [[contents lossyISOLatin1String] stringByEscapingParenthesis] : @"")]; return fdfString; } Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2008-04-08 22:53:34 UTC (rev 3682) +++ trunk/SKDocument.m 2008-04-08 23:46:04 UTC (rev 3683) @@ -1502,7 +1502,7 @@ [string appendFormat:@"%i 0 obj<<%@>>\nendobj\n", i + 1, [[[self notes] objectAtIndex:i] fdfString]]; [annots appendFormat:@"%i 0 R ", i + 1]; } - [string appendFormat:@"%i 0 obj<</%s<</[EMAIL PROTECTED]/%s(%@)", i + 1, SKFDFCatalogKey, SKFDFAnnotationsKey, annots, SKFDFFileKey, filename ? [filename stringByEscapingParenthesis] : @""]; + [string appendFormat:@"%i 0 obj<</%s<</[EMAIL PROTECTED]/%s(%@)", i + 1, SKFDFCatalogKey, SKFDFAnnotationsKey, annots, SKFDFFileKey, filename ? [[filename lossyISOLatin1String] stringByEscapingParenthesis] : @""]; if ([fileIDStrings count] == 2) [string appendFormat:@"/%s[<%@><%@>]", SKFDFFileIDKey, [fileIDStrings objectAtIndex:0], [fileIDStrings objectAtIndex:1]]; [string appendFormat:@">>>>\nendobj\ntrailer\n<</%s %i 0 R>>\n%%EOF\n", SKFDFRootKey, i + 1]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit