营销活动 | 如何在不使用BOM的情况下使用saveFile()函数保存文件

描述 description

问题:当我们使用 saveFile() Adobe Campaign中的JS函数并选择编码为UTF-8,它以UTF-8格式保存文件,并采用BOM格式。

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