NSLog incorrect encoding

前端 未结 4 2121
别跟我提以往
别跟我提以往 2020-11-29 06:44

I\'ve got a problem with the following code:

NSString *strValue=@\"你好\";
char temp[200];
strcpy(temp, [strValue UTF8String]);
printf(\"%s\", temp);
NSLog(@\"         


        
4条回答
  •  情话喂你
    2020-11-29 07:20

    I know you are probably looking for an answer that will help you understand what's going on.

    But this is what you could do to solve your problem right now:

    NSLog(@"%@", strValue);
    

提交回复
热议问题