title: How to convert items of NSArray to utf16 (char16_t)?
body: <p>I have a function that gets all contents of directory whether files or directories and I am using <code>contentsOfDirectoryAtPath</code> to collect the content of a directory then I save the names of files/directories into a container called <code>contentsStore</code> which accepts key&amp;value items of UTF-16 string <code>char16_t</code>. look at the following code to make your vision clear:</p>
  <pre><code>NSArray *dirContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:_dirPath error:nil];
  for(unsigned int i= 0; i&lt; [dirContents count]; i++){
      if(isDir){
          // `contentsStore` is key&amp;value container that accepts utf-16 string (char16_t)
          contentsStore.Add([[dirContents objectAtIndex:i] UTF8String], &quot;directory&quot;);
      } else {
          contentsStore.Add([[dirContents objectAtIndex:i] UTF8String], &quot;file&quot;);
      }
  }
  </code></pre>
  <p>Note that I don't post the entire code because it's big but I just added the important parts that related to the problem. Also, I am using Objective-C just as a bridge to achieve my goal to use Cocoa in macOS but the main language that I use is C++, so, the entire code is a combination of C++/Objective-C.</p>
  <p><strong>How to make the <code>objectAtIndex</code> method to output the item's content as UTF-16 <code>char16_t</code>?</strong></p>