"incomplete universal character name" with stringWithUTF8String

Posted by Nasser on Stack Overflow See other posts from Stack Overflow or by Nasser
Published on 2010-03-26T10:13:43Z Indexed on 2010/03/26 10:23 UTC
Read the original article Hit count: 209

hi, when i try to convert form utf-8 string to NSString like so:

NSString *s = [NSString stringWithUTF8String:"\U0627\U0644\U0641\U0631\U0646"];
NSLog(@"%@", s);

i get the compile error:

incomplete universal character name

note that it sometime just works fine:

NSString *UAE = [NSString stringWithUTF8String:"\U0627\U0644\U0641\U0631\U0646"];
    NSLog(@"%@", UAE);

and the output:

????????

so why is that happening? please help.

© Stack Overflow or respective owner

Related posts about iphone-sdk

Related posts about objective-c