Posterous API,标题中带有特殊字符的新帖子
我正在编写一个脚本,将所有图像从 TwitPic 拖到 Posterous,但标题中的某些字符出现问题,这里有一个示例:
"My awesome title --> some more text"
因此,当我通过 urlencode()< 运行标题时/code> 它在 Posterous 网站上显示为
运行它,正如您所期望的那样。My Awesome title -->更多文本
,如果我在 >
被剥离后没有通过 urlencode()
我还尝试使用 htmlspecialchars()
和类似的方法但收效甚微,如果我通过电子邮件或使用网络界面输入帖子,任何特殊字符都会正确显示。
我只是想让我的标题与 TwitPic 图像标题相匹配......但我似乎无法让它工作。
干杯,本
I'm writing a script to drag all of my images from TwitPic to Posterous but I'm having problems with the some of the characters in the title, here's an example:
"My awesome title --> some more text"
So when I run the title through urlencode()
it appears on the Posterous site as My awesome title --> some more text
, if I don't run it through the urlencode()
anything after the >
is stripped, as you'd expect.
I've also tried to use htmlspecialchars()
and similar with little success, if I email or use the web interface to enter a post any special characters are displayed properly.
I just want my title to match that of the TwitPic image title... but I cannot seem to get it to work.
Cheers, Ben
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
天哪...羞愧地垂下头...
从 TwitPic API 返回的内容已经具有 HTML 字符,如
>
等...运行了通过html_entitiy_decode()
进行标题,效果非常好。哦,好吧,我想没有人死。
Oh my god... hangs head in shame...
The content returned from the TwitPic API already hasd the HTML chars as
>
etc... ran the title throughhtml_entitiy_decode()
and it worked perfectly.Oh well, nobody died I guess.