“incomplete universal character name” with stringWithUTF8String

前端 未结 2 1422
后悔当初
后悔当初 2021-02-07 02:51

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

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


        
2条回答
  •  借酒劲吻你
    2021-02-07 03:31

    incomplete universal character name means that you are missing part of one of the utf8 character that you are trying to write.

    UTF8 spans from 1 byte symbols to 4 byte symbols, probably one of yours is longer that you wrote and you are missing 1 byte or such..

提交回复
热议问题