Re: am i loading this pdf data correctly or not?
Re: am i loading this pdf data correctly or not?
- Subject: Re: am i loading this pdf data correctly or not?
- From: Ben Dougall <email@hidden>
- Date: Fri, 8 Aug 2003 15:28:39 +0100
say i just wanted to use regex, for example, to count the number of
occurrences of the three characters 'obj' in some data (that just
*happens* to be from a pdf data file). pdf semantics are neither here
nor there. when doing this count the regex correctly counts the
occurrence of the pattern i'm searching for up to a certain point. it
stops, due to i think, a particular block of data that's in the
NSString. the particular part of the NSString that makes the regex
stops looks like ... \\001\\u03a98Vv\\u25ca^{\\371\\u220f\\2... so
this would be a problem of my lack of understanding of NSStrings
because i'd expect those character not to cause a problem to NSString
nor a regex. in fact it doesn't seem to cause NSString a problem,
only the regex.
the fine tuned to-the-point question is this. forget pdfs. why does
data in an NSString that looks like this :
... \\001\\u03a98Vv\\u25ca^{\\371\\u220f\\2...
not break an NSString (not break as in when i NSLog output it the
whole thing outputs - from start to finish), but break a regex parse
(break as in it stops prematurely)?
turns out there was in fact a bug in AGRegex - apparently it uses
strlen() to determine the length of the string and was stopping if
where there were null bytes in the string. i'm told it's going to be
fixed soon.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.