We need to send email which contains Pound (currency) symbols in ColdFusion. Before sending email, we are dumping the data into a html file for preview.
我们需要在ColdFusion中发送包含磅(货币)符号的电子邮件。在发送电子邮件之前,我们将数据转储到html文件中进行预览。
- How to send a email with utf-8 encoding in ColdFusion
- How to save a file with utf-8 encoding in ColdFusion
如何在ColdFusion中发送包含utf-8编码的电子邮件
如何在ColdFusion中使用utf-8编码保存文件
3 个解决方案
#1
7
E-Mails are sent in the encoding that is specified in the ColdFusion Administrator. For ColdFusion MX (6.0) and up this is UTF-8 by default.
电子邮件以ColdFusion Administrator中指定的编码发送。对于ColdFusion MX(6.0)及更高版本,默认情况下为UTF-8。
You can explicitly mention the encoding like this, but it should not be necessary.
你可以明确地提到这样的编码,但它不是必需的。
<cfmail type="text/html; Charset=UTF-8" ...><!--- body ---></cfmail>
For the HTML file you dump to disk, the following applies:
对于转储到磁盘的HTML文件,以下内容适用:
<cffile action="write" charset="UTF-8" ...>
And you should have the encoding as a META tag, so the browser you use for preview does not have to guess:
并且您应该将编码作为META标记,因此您用于预览的浏览器不必猜测:
<meta http-equiv="Content-Type" content="text/html; Charset=UTF-8">
#2
0
Try adding <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
in the <head>
tag of your html file.
尝试在html文件的标记中添加 。
#3
0
In addition to marking the mail as UTF-8, you may need to direct ColdFusion that your template being run should be unicode aware as well. Stick this tag right at the top of your template. If you don't you might end up with garbage in the email anyway.
除了将邮件标记为UTF-8之外,您可能还需要指示ColdFusion正在运行的模板也应该是unicode。将此标记粘贴在模板顶部。如果你不这样做,你最终可能会在电子邮件中找到垃圾。
<cfprocessingdirective pageencoding="UTF-8">
There is some fairly good information available from Adobe on the subject here:
Adobe提供了一些关于此主题的相当好的信息:
http://www.adobe.com/support/coldfusion/internationalization/internationalization_cfmx/internationalization_cfmx3.html
#1
7
E-Mails are sent in the encoding that is specified in the ColdFusion Administrator. For ColdFusion MX (6.0) and up this is UTF-8 by default.
电子邮件以ColdFusion Administrator中指定的编码发送。对于ColdFusion MX(6.0)及更高版本,默认情况下为UTF-8。
You can explicitly mention the encoding like this, but it should not be necessary.
你可以明确地提到这样的编码,但它不是必需的。
<cfmail type="text/html; Charset=UTF-8" ...><!--- body ---></cfmail>
For the HTML file you dump to disk, the following applies:
对于转储到磁盘的HTML文件,以下内容适用:
<cffile action="write" charset="UTF-8" ...>
And you should have the encoding as a META tag, so the browser you use for preview does not have to guess:
并且您应该将编码作为META标记,因此您用于预览的浏览器不必猜测:
<meta http-equiv="Content-Type" content="text/html; Charset=UTF-8">
#2
0
Try adding <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
in the <head>
tag of your html file.
尝试在html文件的标记中添加 。
#3
0
In addition to marking the mail as UTF-8, you may need to direct ColdFusion that your template being run should be unicode aware as well. Stick this tag right at the top of your template. If you don't you might end up with garbage in the email anyway.
除了将邮件标记为UTF-8之外,您可能还需要指示ColdFusion正在运行的模板也应该是unicode。将此标记粘贴在模板顶部。如果你不这样做,你最终可能会在电子邮件中找到垃圾。
<cfprocessingdirective pageencoding="UTF-8">
There is some fairly good information available from Adobe on the subject here:
Adobe提供了一些关于此主题的相当好的信息:
http://www.adobe.com/support/coldfusion/internationalization/internationalization_cfmx/internationalization_cfmx3.html