Is there an equivalent to PHP's htmlentities in ColdFusion?
My ColdFusion app is required to create Word 2003 documents, with complex data like images (only a small text portion needs to be dynamic, though). To let this happen, I've saved a Word document that I use as a template in "single-file HTML" (read: MHT), and I insert data at specific points in the file from my ColdFusion scripts.
Passed the quoted-printable cleverness the MHT file format dragged me into, it actually works pretty well. The only problem is that I need special (non-ASCII) characters in my Word documents, and apparently, both my app and Word use a different, non-Unicode encoding.
Now that I have my template and my program, I'm not very enthusiastic about changing their respective encodings. Another requirement is that users should be able to submit new templates, so I can't just change the template's encoding because newer templates will have the same problem.
I thought the simplest way to solve the problem would be to use a function like PH开发者_如何学CP's htmlentities
, that converts every non-ASCII character in an HTML entity. Does ColdFusion have such a function?
XmlFormat will convert ASCII characters in the 159-255 range along with the standard html entities.
You want HTMLEditFormat
精彩评论