Nsstring *subject = @"This is a test";Nsstring *encodedSubject = [subject stringByAddingPercentEscapesUsingEnCoding:NSUTF8StringEnCoding]; //Nsstring *body = @"This is a link: <a href='http://somewhere.com/two.woa/wa?ID=000¶m=0'>click me</a>"; //originalNsstring *body = @"This is a link: <a href='http://somewhere.com/two.woa/wa?ID=000&param=0'>click me</a>"; //have also trIEd &Nsstring *encodedBody = [body stringByAddingPercentEscapesUsingEnCoding:NSUTF8StringEnCoding]; Nsstring *formattedURL = [Nsstring stringWithFormat: @"mailto:myname@somedomain.com?subject=%@&body=%@",encodedSubject,encodedBody];NSURL *url = [[NSURL alloc] initWithString:formattedURL];[[UIApplication sharedApplication] openURL:url];解决方法 和符号将为 URL Encoding标准的HEX 总结
以上是内存溢出为你收集整理的iphone – 如何在HTML属性值的URL中对“&”进行编码?全部内容,希望文章能够帮你解决iphone – 如何在HTML属性值的URL中对“&”进行编码?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)