title: Xcode - UTF-8 String Encoding
body: <p>I have a strange problem encoding my <code>String</code></p>
  
  <p>For example: </p>
  
  <pre><code>NSString *str = @"\u0e09\u0e31\u0e19\u0e23\u0e31\u0e01\u0e04\u0e38\u0e13";
  NSString *utf = [str stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
  NSLog("utf: %@", utf);
  </code></pre>
  
  <p>This worked perfectly in log</p>
  
  <pre><code>utf: ฉันรักคุณ
  </code></pre>
  
  <p>But, when I try using my string that I parsed from JSON with the same string:</p>
  
  <pre><code>//str is string parse from JSON
  NSString *str = [spaces stringByReplacingOccurrencesOfString:@"U" withString:@"u"];
  NSLog("str: %@, str);
  NSString *utf = [str stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
  NSLog("utf: %@", utf);
  </code></pre>
  
  <p>This didn't work in log</p>
  
  <pre><code>str: \u0e09\u0e31\u0e19\u0e23\u0e31\u0e01\u0e04\u0e38\u0e13
  utf: \u0e09\u0e31\u0e19\u0e23\u0e31\u0e01\u0e04\u0e38\u0e13
  </code></pre>
  
  <p>I have been finding the answer for hours but still have no clue</p>
  
  <p>Any would be very much appreciated! Thanks!</p>