Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <code>unichar</code> type is defined to be a 16-bit unicode value (eg, as indirectly documented in the <a href="https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html">description of the %C specifier</a>), and you can get a <code>unichar</code> from a given position in an <code>NSString</code> using <a href="https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/occ/instm/NSString/characterAtIndex%3a"><code>characterAtIndex:</code></a>, or use <a href="https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/occ/instm/NSString/getCharacters%3arange%3a"><code>getCharacters:range:</code></a> if you want to fill a C array of unichars from the <code>NSString</code> more quickly than by querying them one by one.</p> <p><code>NSUTF32StringEncoding</code> is also a valid string encoding, as are a couple of endian-specific variants, in case you want to be absolutely future proof. You'd get a C array of those using the much more longwinded <a href="https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/occ/instm/NSString/getBytes%3amaxLength%3ausedLength%3aencoding%3aoptions%3arange%3aremainingRange%3a"><code>getBytes:maxLength:usedLength:encoding:options:range:remainingRange:</code></a>.</p> <p>EDIT: so, e.g.</p> <pre><code>NSString *str = @"A"; NSLog(@"16-bit unicode values are:"); for(int index = 0; index &lt; [str length]; index++) NSLog(@"%04x", [str characterAtIndex:index]); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload