title: How to know a NSString is already decoded from UTF8?
body: <p>I received data from server in json format, in which contain utf8 string. I use the following code to decode:</p>
  
  <pre>
  
  + (NSString*)decodeUTF8String:(NSString*)utf8String
  {
      if (utf8String == nil) return nil;
  
      const char* str = [utf8String cStringUsingEncoding:NSISOLatin1StringEncoding];
      if (str == nil) return nil;
  
      NSString* res = [NSString stringWithCString:str encoding:NSUTF8StringEncoding];
  
      return res;
  }
  
  </pre>
  
  <p>In return, how can we know that a string is already decoded from UTF8? The thing is if we send a already decoded string to the above function, it will returns incorrect result (sometime it returns nil value).</p>
  
  <p>For example:</p>
  
  <pre>
  json looks like this : { "name": "Innoviris Demo Session\u00c3\u00a9\u00c3\u00a9\u00c3\u00a9", ...} 
  
  //- parse json
  NSString* utf8String = @"Innoviris Demo SessionÃ©Ã©Ã©";
  
  //- decode
  NSString* decodedString = [self decodeUTF8String:utf8String]; //- decodeString = @"Innoviris Demo Sessionééé" ---> correctly
  
  //- decode again
  NSString* decodedString2 = [self decodeUTF8String:decodedString]; //- decodeString2 = nil ---> unexpected result
  </pre>