title: How to convert from NSString to const char* with umlauts in Objective-C?
body: <p>I have a problem with umlauts in a NSString converting to const char*.</p>
  
  <p>This method parses a textfile of words (line by line), saves the words as strings in NSArray *results. Then convert to const char <em>tmpConstChars. This const char</em> saves, for example, an 'ä' like '√§'. How to convert from NSString to const char * - I Thought this is correct.</p>
  
  <pre><code>- (void)inputWordsByFile:(NSString *)path
  {
  
      NSError *error = [[NSError alloc] init];
      NSString *content = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&amp;error];
      NSArray *results = [content componentsSeparatedByString:@"\n"];
  
      NSMutableArray *words = [[NSMutableArray alloc] initWithArray:results];
      [words removeLastObject];
      for(int i=0; i&lt;[words count]; i++){
  
      const char *tmpConstChars = [[words objectAtIndex:i] UTF8String];
      [self addWordToTree:tmpConstChars];
  
      }
  }
  </code></pre>