I’m trying to get a ® in the cfmail subject line. ...
# cfml-general
j
I’m trying to get a ® in the cfmail subject line. I’ve tried that character, I’ve tried ®, I added utf-8 charset, I tried saving it in a variable and outputting…all no good. Anyone had success with this?
Ok, the solution is to add <cfprocessingdirective pageEncoding=“utf-8”> before the cfmail tag. Fixed!
t
given that was the solution, I wonder if saving the file with iso-8859-1 encoding instead would also work. That's what Java is defaulting to (unless you add -Dfile.coding="UTF8" to your JVM args)
👍🏻 1
a
Does your code editor not embed the BOM? As Tim says, Most text editors will let you save the encoding you want into the file. It may that you are but saving with the a different encoding.
j
Ehh, I switch between CF Builder, VS Code, BB Edit, and DreamWeaver. I’ve never had an issue before. I’m assuming it’s a cfmail tag thing.
a
What's the file encoding that's saved for the file with the cfmail in it?
Just tested (on ACF) and do get the
®
in the cfmail subject line without needing to add a cfprocessingdirective. My JVM is using a Java File Encoding of UTF8
j
Ahh. It says Java File Encoding: Cp1252 for the JVM. But the actual file is UTF-8 when it’s local.
a
I think if you save your file as ut8bom (UTF8 with BOM) then that'll do the same as your cfprocessingdirective is.
or change the JVM file encoding 🙂
☝🏻 1