来自 php mail() 的电子邮件中的 HTML 实体
我在尝试获取 HTML 电子邮件活动来呈现我需要的正确文本时遇到了一个奇怪的问题。
我是电子邮件底部的法律术语,有时我需要添加商标符号。我已将所有这些实例转换为 ™
、$#0153;
或 ™
,当我运行时在本地的邮件脚本中,一切看起来都应该如此,但是当我在目标服务器上运行脚本时,所有这些商标实例都显示一个空框字符。
我应该注意到,在电子邮件的其他地方,我使用了其他渲染良好的 HTML 实体... –
、’
、& ;ldquo;
- 没问题,只是这个该死的™让我发疯。
违规代码:
....DisplayPort™连接器和/或 DisplayPort™兼容
...
呈现为
I'm having a strange problem trying to get an HTML email campaign to render the proper text I need.
I'm the legalese at the bottom of my email, there are instances where I need to add a trademark symbol. I've converted all those instances to
, $#0153;
or ™
, and when I run the mail script locally, everything looks as it should, however when I run the script on the intended server, all those trademark instances show an empty box character instead.
I should note that elsewhere on the email, I'm using other HTML entities that render fine... –
, ’
, “
- No problems, only this damn ™ thats driving me crazy.
The offending code:
....DisplayPort connectors, and/or DisplayPort compliant
....
renders as
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题解决了!
显然,您还可以使用实体代码
™
作为商标,这是我不知道的。它仍然没有解释为什么任何其他实体代码不起作用,但它为我提供了一个可行的解决方案,所以我称这个问题已得到解答。感谢大家的帮助,非常感谢。
Problem Solved!
Apparently you can also use the entity code
™
for a trademark, which I was unaware of. It still doesnt explain why any of the other entity codes didn't work, but it has provided me with a working solution, so I'm calling this question answered.Thanks to all for your help, much appreciated.
检查您的“主”服务器和“目标”服务器正在使用什么字符集。如果它们不匹配(例如在家中使用 utf-8,但在工作中使用 latin-1),则会丢弃任何非标准 ascii 字符,例如版权符号。
Check what character sets your "home" server and the "intended" server are using. If they're mismatched (like utf-8 at home, but latin-1 at work), that'd trash any of the non-standard ascii characters like the copyright symbol.