所以我试图编码一个多行字符串并通过HTTP发送到服务器,我正在编码这个字符串:
#include <stdio.h>
int main(void)
{
printf(\"Code Cabana!\");
return 0;
}
当NSLog
我得到这个时:
151657384nclude23Cstdio.h3.825303E-2990X1.242D78P-1047220220220220220220220220220220220220 0nt2ain(void)27B0X1.16BC009216BCP-877220220220220220220220220220220220220220220 0xe7fe00rintf(硨ode⭸abana!2;2202202202202202202202202202202202202202202eturn222022022022022022022022022022022022020A15203843
我正在使用此代码对其进行编码:
NSString *urlCode = [[NSString stringWithFormat:@"#include <stdio.h>\n int main(void){\nprintf(\"Code Cabana!\");return 0;\n}"] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];