Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gadget,用XML编写Unicode数据_Xml_Filesystemobject - Fatal编程技术网

Gadget,用XML编写Unicode数据

Gadget,用XML编写Unicode数据,xml,filesystemobject,Xml,Filesystemobject,我想在Gadget中,将Unicode数据写入XML文件(我使用UTF-8对XML文档进行编码)。 要写入XML,请使用“fso=new-ActiveXObject(“Scripting.FileSystemObject”);”。 但写入后,数据不是Unicode。 此外,我需要Unicode格式的数据。 谢谢 var objStream=新的ActiveXObject(“ADODB.Stream”) objStream.Type=2//1=二进制数据,2=文本数据(默认值) Open() ob

我想在Gadget中,将Unicode数据写入XML文件(我使用UTF-8对XML文档进行编码)。
要写入XML,请使用“fso=new-ActiveXObject(“Scripting.FileSystemObject”);”。
但写入后,数据不是Unicode。
此外,我需要Unicode格式的数据。
谢谢


var objStream=新的ActiveXObject(“ADODB.Stream”)
objStream.Type=2//1=二进制数据,2=文本数据(默认值)
Open()
objStream.charset=“UTF-8”
objStream.WriteText(数据)
objStream.SaveToFile(System.Gadget.path+“\PhonebookContacts.xml”,2)
//1=如果文件不存在,则创建新文件(默认)
//2=如果文件已存在,则使用当前打开的流对象中的数据覆盖该文件