I’m trying to auto-generate a plain text email with a trademark symbol in it. I’ve tried everything I can think of but it’s still not going through.
<cfmail from='#x#' to='#y#' subject='test' charset='UTF-8'> ™ ™ #Chr(153)# </cfmail>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is an encoding issue.
You state the mail is encoded as UTF-8, but
Chr(153)does not return a trademark symbol in Unicode. It does in Windows-1252, butChr()works with Unicode code points.Use
Chr(8482)to nail it to the Unicode TM symbol.I’ve found an info page that outlines the issue nicely.
By the way, writing the literal TM symbol works for me as well. But this assumes your .cfm files are in fact encoded as Windows-1252 and that the ColdFusion runtime is configured to expect this (Both of which is the default on Windows systems, where I’ve tested it on. Analog rules apply to other systems.). ColdFusion converts all strings to Unicode internally, so maybe something is broken in this chain of expectations in your set-up.