简体   繁体   English

SAS编码html文件utf-8

[英]SAS Encoding html file utf-8

Basically,I have a SAS script which sends email to different users. 基本上,我有一个SAS脚本,可以向不同的用户发送电子邮件。 I want to attach some html file with encoding to utf-8 but it doesn't work: " Invalid string ". 我想将一些带有编码的html文件附加到utf-8但是它不起作用:“ Invalid string ”。

This is the example script: 这是示例脚本:

filename outmail email encoding='wcyrillic'
subject="Test"
from='test.test@test.kz';

data _NULL_ ; 
file outmail 
to = ('test2.test@test.kz')    
attach=("/user_data/Kontury_Vse_Filialy.html" ENCODING='utf-8');    
put"Hello!"; 
run;

It works properly on attaching other files such csv. 它可以在附加其他文件(例如csv.正常工作csv. or attaching html with encoding 'wcyrillic' .It seems to me that SAS has troubles with encoding html files from CP1251 to utf-8 , but it looks weird. 或附加带有'wcyrillic'编码的html。在我看来,SAS在将CP1251 html文件编码为utf-8遇到了麻烦,但是看起来很奇怪。

ENCODING option defines what encoding SAS have to use to read attached file. ENCODING选项定义SAS必须使用哪种编码来读取附件。

If you want to write attachment with utf-8 encoding to email stream use OUTENCODING option instead. 如果要使用utf-8编码的附件写入电子邮件流,请使用OUTENCODING选项。

attach=("/user_data/Kontury_Vse_Filialy.html" OUTENCODING='utf-8'); 

More details about attach options you can find here . 您可以在此处找到有关附加选项的更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM