title: NSCharacter Set uses int's but i need unassigned short?
body: <p>I am using <a href="https://github.com/mwaterfall/MWFeedParser" rel="nofollow">MWFeedParser</a> to add a feed into my app. Now the framework passes date's and I it has a few warnings mainly due to older type of code.</p>
  
  <p>Now there are 4 warnings left which are all the same and technically I can fix them and remove them so that the warnings are gone, but then I get left with the app not working properly.</p>
  
  <p>The code concerning is:</p>
  
  <pre><code>    // Character sets
  NSCharacterSet *stopCharacters = [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat:@"&lt; \t\n\r%C%C%C%C", 0x0085, 0x000C, 0x2028, 0x2029]];
  </code></pre>
  
  <p>Now the bit that is the warning is:</p>
  
  <pre><code>\t\n\r%C%C%C%C", 0x0085, 0x000C, 0x2028, 0x2029]];
  </code></pre>
  
  <p>The warning is:</p>
  
  <blockquote>
    <p>Format specifies type 'unsigned short' but the argument has type 'int'</p>
  </blockquote>
  
  <p>So I changed into:</p>
  
  <pre><code>\t\n\r%i%i%i%i", 0x0085, 0x000C, 0x2028, 0x2029]];
  </code></pre>
  
  <p>which indeed removed the warnings and gave me perfect code:-) (no warnings or errors)</p>
  
  <p>When I then ran the app it did not parse the date and it was not able to open the link.
  I am not sure if this a is C thing, but right now it is definitely outside of my knowledge field. Is there anyone who can help me that can fix this problem, and still have it working in the app??</p>
  
  <p>Thank you in advance:-)</p>
  
  <h2><strong>EDIT</strong></h2>
  
  <pre><code>     - (NSString *)stringByConvertingHTMLToPlainText {
  
  // Pool
  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
  
  // Character sets
  NSCharacterSet *stopCharacters = [NSCharacterSet characterSetWithCharactersInString:@"&lt; \t\n\r\x0085\x000C\u2028\u2029"];    
  NSCharacterSet *newLineAndWhitespaceCharacters = [NSCharacterSet characterSetWithCharactersInString:@"&lt; \t\n\r\205\014\u2028\u2029"];
  
  
  NSCharacterSet *tagNameCharacters = [NSCharacterSet characterSetWithCharactersInString:@"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"];
  
  // Scan and find all tags
  NSMutableString *result = [[NSMutableString alloc] initWithCapacity:self.length];
  NSScanner *scanner = [[NSScanner alloc] initWithString:self];
  [scanner setCharactersToBeSkipped:nil];
  [scanner setCaseSensitive:YES];
  NSString *str = nil, *tagName = nil;
  BOOL dontReplaceTagWithSpace = NO;
  do {
  
      // Scan up to the start of a tag or whitespace
      if ([scanner scanUpToCharactersFromSet:stopCharacters intoString:&amp;str]) {
          [result appendString:str];
          str = nil; // reset
      }
  
      // Check if we've stopped at a tag/comment or whitespace
      if ([scanner scanString:@"&lt;" intoString:NULL]) {
  
          // Stopped at a comment or tag
          if ([scanner scanString:@"!--" intoString:NULL]) {
  
              // Comment
              [scanner scanUpToString:@"--&gt;" intoString:NULL]; 
              [scanner scanString:@"--&gt;" intoString:NULL];
  
          } else {
  
              // Tag - remove and replace with space unless it's
              // a closing inline tag then dont replace with a space
              if ([scanner scanString:@"/" intoString:NULL]) {
  
                  // Closing tag - replace with space unless it's inline
                  tagName = nil; dontReplaceTagWithSpace = NO;
                  if ([scanner scanCharactersFromSet:tagNameCharacters intoString:&amp;tagName]) {
                      tagName = [tagName lowercaseString];
                      dontReplaceTagWithSpace = ([tagName isEqualToString:@"a"] ||
                                                 [tagName isEqualToString:@"b"] ||
                                                 [tagName isEqualToString:@"i"] ||
                                                 [tagName isEqualToString:@"q"] ||
                                                 [tagName isEqualToString:@"span"] ||
                                                 [tagName isEqualToString:@"em"] ||
                                                 [tagName isEqualToString:@"strong"] ||
                                                 [tagName isEqualToString:@"cite"] ||
                                                 [tagName isEqualToString:@"abbr"] ||
                                                 [tagName isEqualToString:@"acronym"] ||
                                                 [tagName isEqualToString:@"label"]);
                  }
  
                  // Replace tag with string unless it was an inline
                  if (!dontReplaceTagWithSpace &amp;&amp; result.length &gt; 0 &amp;&amp; ![scanner isAtEnd]) [result appendString:@" "];
  
              }
  
              // Scan past tag
              [scanner scanUpToString:@"&gt;" intoString:NULL];
              [scanner scanString:@"&gt;" intoString:NULL];
  
          }
  
      } else {
  
          // Stopped at whitespace - replace all whitespace and newlines with a space
          if ([scanner scanCharactersFromSet:newLineAndWhitespaceCharacters intoString:NULL]) {
              if (result.length &gt; 0 &amp;&amp; ![scanner isAtEnd]) [result appendString:@" "]; // Dont append space to beginning or end of result
          }
  
      }
  
  } while (![scanner isAtEnd]);
  
  // Cleanup
  [scanner release];
  
  // Decode HTML entities and return
  NSString *retString = [[result stringByDecodingHTMLEntities] retain];
  [result release];
  
  // Drain
  [pool drain];
  
  // Return
  return [retString autorelease];
  </code></pre>
  
  <p>}</p>