营销活动 | 如何在不使用BOM的情况下使用saveFile()函数保存文件
描述 description
问题:当我们在Adobe Campaign中使用saveFile() JS函数并选择编码为UTF-8时,它将以BOM格式将文件保存为UTF-8。
Syntax: saveFile ("<Text to be saved>", "<Server location where the file will be saved>/<File name>","<Encoding>");
解决方法 resolution
默认情况下,当我们使用saveFile()函数时:
saveFile ("<Text to be saved>", "<Server location where the file will be saved>/<File name>","utf-8");
文件以UTF-8格式和BOM保存
什么是BOM:
字节顺序标记(BOM)是Unicode字符U+FEFF 字节顺序标记 (BOM),在文本流开头作为幻数出现,可以向读取文本的程序发出若干信号:
- 文本流的字节顺序或字节顺序;
- 文本流的编码方式为Unicode,具有较高的可信度;
- 将文本流编码为哪种Unicode。
为了避免这种情况,解决方法是跳过函数语法中的编码部分。 因此,请将其用于:
saveFile ("<Text to be saved>", "<Server location where the file will be saved>/<File name>");
这将以UTF-8格式保存文件,但不使用BOM
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f