How to save a file in UTF-8 format

We need to send an email containing pound (currency) symbols to ColdFusion. Before sending email, we upload the data to an html file for preview.

  • How to send an email using utf-8 encoding in ColdFusion
  • How to save utf-8 encoded file in ColdFusion
+4
source share
3 answers

E-Mails are sent in the encoding specified by the ColdFusion Administrator. For ColdFusion MX (6.0) and above, this is UTF-8 by default.

You can explicitly specify such an encoding, but this is not necessary.

<cfmail type="text/html; Charset=UTF-8" ...><!--- body ---></cfmail> 

For the HTML file that you flush to disk, the following applies:

 <cffile action="write" charset="UTF-8" ...> 

And you should have the encoding as the META tag, so the browser you use for preview should not guess:

 <meta http-equiv="Content-Type" content="text/html; Charset=UTF-8"> 
+7
source

Try adding <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> to the <head> your html file.

0
source

In addition to marking mail as UTF-8, you may need to direct ColdFusion to ensure that your template, which must be running, must also be known as unicode. Glue this tag right at the top of the template. If you do not, you may end up with garbage in the letter.

  <cfprocessingdirective pageencoding = "UTF-8">

There is some pretty good information available from Adobe on this subject:

http://www.adobe.com/support/coldfusion/internationalization/internationalization_cfmx/internationalization_cfmx3.html

0
source

All Articles