title: NSURL to NSString Conversion doing strange things
body: <p>I'm trying to convert a <code>NSURL</code> to a <code>NSString</code> to use elsewhere in my program.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>- (IBAction)openExistingDocument:(id)sender {
  NSOpenPanel* panel = [NSOpenPanel openPanel];
  [panel setCanChooseDirectories:NO];
  [panel setAllowsMultipleSelection:NO];
  [panel setMessage:@"Please select a File or Folder containing your character's .png layers"];
  
  [panel beginWithCompletionHandler:^(NSInteger result){
      if (result == NSFileHandlingPanelOKButton) {
  
          NSURL*  theDoc = [[panel URLs] objectAtIndex:0];
          NSString* unformattedURL = [NSString stringWithContentsOfURL:theDoc encoding:NSASCIIStringEncoding error:NULL];
          NSString * formattedURL = [unformattedURL stringByReplacingOccurrencesOfString:@"file:/" withString:@""];
          NSLog(@"the url says:%@", theDoc);
          NSLog(@"the unformatted string says: %@", unformattedURL);
          NSLog(@"the formatted string says: %@", formattedURL);
      }
  
  }];
  }
  </code></pre>
  
  <p>When I run the program, here's what my command line outputs:</p>
  
  <pre><code>2012-01-29 18:43:19.205 Cocos2dCharacterRigger[516:407] the url says:file://localhost/Users/*****/Desktop/mockupsite.jpg
  2012-01-29 18:43:19.213 Cocos2dCharacterRigger[516:407] the unformatted string says: ÿØÿá.]Exif
  2012-01-29 18:43:19.219 Cocos2dCharacterRigger[516:407] the formatted string says: ÿØÿá.]Exif
  </code></pre>
  
  <p>Can someone point out what I'm doing incorrectly?</p>