title: char* to NSData issue
body: <p>I am trying to write a function that takes <code>char*</code> as an input parameter and will serialize it into JSON.</p>
  
  <p>I am running into an issue with converting the input parameter, <code>options</code> to NSData. I used the following line of code:</p>
  
  <p><code>
  NSData *data = [NSData dataWithBytes:options length:sizeof(options)];
  </code></p>
  
  <p>This did not work. A different set of code did work:</p>
  
  <p><code>
  NSString* stringFromChar = [[NSString alloc] initWithUTF8String:options];
  NSData * data = [stringFromChar dataUsingEncoding:NSUTF8StringEncoding];
  </code></p>
  
  <p>I am curious about why it was necessary to convert my code from <code>char*</code> to an NSString and then to NSData and why I could not do that directly. Is there a way to directly convert <code>char*</code> to NSData without this intermediary step? Thanks.</p>