title: NSString stringWithCharacters Unicode Problem
body: <p>This has got to be simple -- surely this method is supposed to work -- but I'm having some kind to two-byte-to-one-byte problem, I think.</p>
  
  <p>The purpose of the code is to generate a string of 0 characters of a certain length (10 minus the number of digits that will be tacked onto the end). It looks like this:</p>
  
  <pre><code>const unichar zero = 0x0030;
  NSString *zeroBuffer = [NSString stringWithCharacters:&amp;zero length:(10 - [[NSString stringWithFormat:@"%i", photoID] length])];  
  </code></pre>
  
  <p>Alternate second line (casting the thing at address &amp;zero): </p>
  
  <pre><code>NSString *zeroBuffer = [NSString stringWithCharacters:(unichar *)&amp;zero length:(10 - [[NSString stringWithFormat:@"%i", photoID] length])];
  </code></pre>
  
  <p><strong>0x0030</strong> is the address of the numeral 0 in the Basic Latin portion of the unicode table.</p>
  
  <p>If photoID is 123 I'd want zeroBuffer to be @"0000000". What it actually ends up as is a zero and then some crazy unicode characters along the lines of (not sure how this will show) this:</p>
  
  <p>0䪨 燱ܾ뿿﹔</p>
  
  <p>I'm assuming that I've got data crossing character boundaries or something. I've temporarily rewritten it as a dumb substring thing, but this seems like it would be more efficient. </p>
  
  <p>What am I doing wrong?</p>