title: How do I convert NSString to NSData?
body: <p>I have this line of code to convert NSString to NSData:</p>
  
  <pre><code>NSData *data = [NSData dataWithBytes:[message UTF8String] length:[message lengthOfBytesUsingEncoding:NSUTF8StringEncoding]];
  </code></pre>
  
  <p>How do I do this in Unicode instead of UTF8? My message may contain cyrillic characters or diacritical marks.</p>